diff --git a/.eslintignore b/.eslintignore index d3c328e2c1..9fb0480a5a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,6 @@ *~ app/dist/ -app/dist-trezor/ +app/trezor-prebuild/build/ app/main.js app/main.js.map app/i18n/lib/ diff --git a/.gitignore b/.gitignore index c0bb7983b9..716a443a48 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *~ app/dist/ -app/dist-trezor/ app/main.js app/main.js.map app/main.js.LICENSE.txt diff --git a/.prettierignore b/.prettierignore index c1acc4068f..949e849d8a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,7 +3,7 @@ /bin /node_modules /app/dist -/app/dist-trezor +/app/trezor-prebuild/build /app/middleware/ln/*_pb.js /app/middleware/ln/google/api/*_pb.js /app/middleware/walletrpc/*_pb.js diff --git a/app/actions/TrezorActions.js b/app/actions/TrezorActions.js index 96e1175897..1488f302a8 100644 --- a/app/actions/TrezorActions.js +++ b/app/actions/TrezorActions.js @@ -23,14 +23,13 @@ import { SIGNMESSAGE_SUCCESS } from "./ControlActions"; import { getAmountFromTxInputs, getTxFromInputs } from "./TransactionActions"; - -const session = require("trezor-connect").default; +const session = require("@trezor/connect-web").default; const { TRANSPORT_EVENT, UI, UI_EVENT, DEVICE_EVENT -} = require("trezor-connect"); +} = require("@trezor/connect-web"); const CHANGE = "device-changed"; const DISCONNECT = "device-disconnect"; const CONNECT = "device-connect"; @@ -61,11 +60,10 @@ export const initTransport = async (session, debug) => { await session .init({ connectSrc: "./", - env: "web", + transports: ["BridgeTransport"], lazyLoad: false, popup: false, transportReconnect: false, - webusb: false, manifest: { email: "joegruffins@gmail.com", appUrl: "https://github.com/decred/decrediton" @@ -288,6 +286,18 @@ function setDeviceListeners(dispatch, getState) { case UI.FIRMWARE_PROGRESS: { console.log("Trezor update progress: " + event.payload.progress + "%"); + break; + } + + case UI.SELECT_DEVICE: { + if (event.payload.devices.length > 0) { + session.uiResponse({ + type: UI.RECEIVE_DEVICE, + payload: event.payload.devices[0] + }); + } else { + // no devices connected, waiting for connection + } } } }); diff --git a/app/trezor-iframe.development.html b/app/trezor-iframe.development.html deleted file mode 100644 index 5fac75fc35..0000000000 --- a/app/trezor-iframe.development.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - TrezorConnect | Trezor - - - - - - - - - - - - diff --git a/app/trezor-prebuild/README.md b/app/trezor-prebuild/README.md new file mode 100644 index 0000000000..4e06e8b805 --- /dev/null +++ b/app/trezor-prebuild/README.md @@ -0,0 +1,7 @@ +This is used to contact trezor-bridge on a separate iframe in the wallet. + +It is created by following the instructions at https://github.com/trezor/trezor-suite and is the package in packages/connect-iframe. + +Current build is at commit 109db0a3f6fc6fc5cdb24098ee50480692c92dbf + +TODO: Build this with webpack. diff --git a/app/trezor-prebuild/build/data/bridge/releases.json b/app/trezor-prebuild/build/data/bridge/releases.json new file mode 100644 index 0000000000..1d1a535863 --- /dev/null +++ b/app/trezor-prebuild/build/data/bridge/releases.json @@ -0,0 +1,41 @@ +[ + { + "version": [2, 0, 27], + "directory": "bridge/{version}/", + "packages": [ + { + "platform": ["deb64"], + "name": "Linux 64-bit (deb)", + "url": "trezor-bridge_{version}_amd64.deb" + }, + { + "platform": ["rpm64"], + "name": "Linux 64-bit (rpm)", + "url": "trezor-bridge-{version}-1.x86_64.rpm" + }, + { + "platform": ["deb32"], + "name": "Linux 32-bit (deb)", + "url": "trezor-bridge_{version}_i386.deb" + }, + { + "platform": ["rpm32"], + "name": "Linux 32-bit (rpm)", + "url": "trezor-bridge-{version}-1.i386.rpm" + }, + { + "platform": ["mac"], + "name": "macOS", + "url": "trezor-bridge-{version}.pkg", + "signature": "trezor-bridge-{version}.pkg.asc" + }, + { + "platform": ["win32", "win64"], + "name": "Windows", + "url": "trezor-bridge-{version}-win32-install.exe", + "signature": "trezor-bridge-{version}-win32-install.exe.asc" + } + ], + "changelog": "* Fix Certificate issue on Windows" + } +] diff --git a/app/trezor-prebuild/build/data/coins-eth.json b/app/trezor-prebuild/build/data/coins-eth.json new file mode 100644 index 0000000000..475ced02df --- /dev/null +++ b/app/trezor-prebuild/build/data/coins-eth.json @@ -0,0 +1,75 @@ +[ + { + "blockchain_link": { + "type": "blockbook", + "url": ["https://eth1.trezor.io", "https://eth2.trezor.io"] + }, + "chain": "eth", + "chain_id": 1, + "name": "Ethereum", + "shortcut": "ETH", + "slip44": 60, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "url": "https://ethereum.org" + }, + { + "blockchain_link": { + "type": "blockbook", + "url": ["https://sepolia1.trezor.io"] + }, + "chain": "sep", + "chain_id": 11155111, + "name": "Sepolia", + "rskip60": false, + "shortcut": "tSEP", + "slip44": 1, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.11.2", + "trezor2": "2.5.2" + }, + "url": "https://sepolia.otterscan.io" + }, + { + "blockchain_link": { + "type": "blockbook", + "url": ["https://goerli1.trezor.io", "https://goerli2.trezor.io"] + }, + "chain": "gor", + "chain_id": 5, + "name": "G\u00f6rli", + "shortcut": "tGOR", + "slip44": 1, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.11.2", + "trezor2": "2.5.2" + }, + "url": "https://goerli.net/#about" + }, + { + "blockchain_link": { + "type": "blockbook", + "url": ["https://etc1.trezor.io", "https://etc2.trezor.io"] + }, + "chain": "etc", + "chain_id": 61, + "name": "Ethereum Classic", + "shortcut": "ETC", + "slip44": 61, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "url": "https://ethereumclassic.org" + } +] diff --git a/app/trezor-prebuild/build/data/coins.json b/app/trezor-prebuild/build/data/coins.json new file mode 100644 index 0000000000..6d508a7916 --- /dev/null +++ b/app/trezor-prebuild/build/data/coins.json @@ -0,0 +1,2402 @@ +{ + "bitcoin": [ + { + "address_type": 0, + "address_type_p2sh": 5, + "bech32_prefix": "bc", + "blockchain_link": { + "type": "blockbook", + "url": [ + "https://btc1.trezor.io", + "https://btc2.trezor.io", + "https://btc3.trezor.io", + "https://btc4.trezor.io", + "https://btc5.trezor.io" + ] + }, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "Bitcoin", + "coin_name": "Bitcoin", + "coin_shortcut": "BTC", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Economy": 70, + "High": 200, + "Low": 10, + "Normal": 140 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 2000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Bitcoin", + "overwintered": false, + "segwit": true, + "shortcut": "BTC", + "signed_message_header": "Bitcoin Signed Message:\n", + "slip44": 0, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.5.2", + "trezor2": "2.0.5" + }, + "taproot": true, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 44728019, + "xpub_magic_multisig_segwit_p2sh": 43365439, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 111, + "address_type_p2sh": 196, + "bech32_prefix": "bcrt", + "blockchain_link": null, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "Regtest", + "coin_name": "Regtest", + "coin_shortcut": "REGTEST", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206", + "is_testnet": true, + "max_address_length": 34, + "maxfee_kb": 10000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Regtest", + "overwintered": false, + "segwit": true, + "shortcut": "REGTEST", + "signed_message_header": "Bitcoin Signed Message:\n", + "slip44": 1, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.8.2", + "trezor2": "2.1.1" + }, + "taproot": true, + "timestamp": false, + "xprv_magic": 70615956, + "xpub_magic": 70617039, + "xpub_magic_multisig_segwit_native": 39277699, + "xpub_magic_multisig_segwit_p2sh": 37915119, + "xpub_magic_segwit_native": 73342198, + "xpub_magic_segwit_p2sh": 71979618 + }, + { + "address_type": 111, + "address_type_p2sh": 196, + "bech32_prefix": "tb", + "blockchain_link": { + "type": "blockbook", + "url": ["https://tbtc1.trezor.io", "https://tbtc2.trezor.io"] + }, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "Testnet", + "coin_name": "Testnet", + "coin_shortcut": "TEST", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943", + "is_testnet": true, + "max_address_length": 34, + "maxfee_kb": 10000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Testnet", + "overwintered": false, + "segwit": true, + "shortcut": "TEST", + "signed_message_header": "Bitcoin Signed Message:\n", + "slip44": 1, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.5.2", + "trezor2": "2.0.5" + }, + "taproot": true, + "timestamp": false, + "xprv_magic": 70615956, + "xpub_magic": 70617039, + "xpub_magic_multisig_segwit_native": 39277699, + "xpub_magic_multisig_segwit_p2sh": 37915119, + "xpub_magic_segwit_native": 73342198, + "xpub_magic_segwit_p2sh": 71979618 + }, + { + "address_type": 53, + "address_type_p2sh": 55, + "bech32_prefix": "acm", + "blockchain_link": null, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Actinium", + "coin_name": "Actinium", + "coin_shortcut": "ACM", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 1000 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "28d77872e23714562f49a1be792c276623c1bbe3fdcf21b6035cfde78b00b824", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 320000000000, + "min_address_length": 27, + "minfee_kb": 100000, + "name": "Actinium", + "overwintered": false, + "segwit": true, + "shortcut": "ACM", + "signed_message_header": "Actinium Signed Message:\n", + "slip44": 228, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.7.2", + "trezor2": "2.0.10" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 76067358, + "xpub_magic_multisig_segwit_p2sh": 76067358, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 55, + "address_type_p2sh": 16, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Axe", + "coin_name": "Axe", + "coin_shortcut": "AXE", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 5460, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "00000c33631ca6f2f61368991ce2dc03306b5bb50bf7cede5cfbba6db38e52e6", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 21000000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Axe", + "overwintered": false, + "segwit": false, + "shortcut": "AXE", + "signed_message_header": "DarkCoin Signed Message:\n", + "slip44": 4242, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.7.3", + "trezor2": "2.0.11" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 50221816, + "xpub_magic": 50221772, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 0, + "address_type_p2sh": 5, + "bech32_prefix": null, + "blockchain_link": { + "type": "blockbook", + "url": [ + "https://bch1.trezor.io", + "https://bch2.trezor.io", + "https://bch3.trezor.io", + "https://bch4.trezor.io", + "https://bch5.trezor.io" + ] + }, + "blocktime_seconds": 600, + "cashaddr_prefix": "bitcoincash", + "coin_label": "Bitcoin Cash", + "coin_name": "Bcash", + "coin_shortcut": "BCH", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 1 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": true, + "fork_id": 0, + "hash_genesis_block": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 14000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Bitcoin Cash", + "overwintered": false, + "segwit": false, + "shortcut": "BCH", + "signed_message_header": "Bitcoin Signed Message:\n", + "slip44": 145, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 111, + "address_type_p2sh": 196, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 600, + "cashaddr_prefix": "bchtest", + "coin_label": "Bitcoin Cash Testnet", + "coin_name": "Bcash Testnet", + "coin_shortcut": "TBCH", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": true, + "fork_id": 0, + "hash_genesis_block": "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943", + "is_testnet": true, + "max_address_length": 34, + "maxfee_kb": 10000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Bitcoin Cash Testnet", + "overwintered": false, + "segwit": false, + "shortcut": "TBCH", + "signed_message_header": "Bitcoin Signed Message:\n", + "slip44": 1, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 70615956, + "xpub_magic": 70617039, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 38, + "address_type_p2sh": 23, + "bech32_prefix": "btg", + "blockchain_link": { + "type": "blockbook", + "url": [ + "https://btg1.trezor.io", + "https://btg2.trezor.io", + "https://btg3.trezor.io", + "https://btg4.trezor.io", + "https://btg5.trezor.io" + ] + }, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "Bitcoin Gold", + "coin_name": "Bgold", + "coin_shortcut": "BTG", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 30 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": true, + "fork_id": 79, + "hash_genesis_block": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 380000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Bitcoin Gold", + "overwintered": false, + "segwit": true, + "shortcut": "BTG", + "signed_message_header": "Bitcoin Gold Signed Message:\n", + "slip44": 156, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 76067358, + "xpub_magic_multisig_segwit_p2sh": 76067358, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 111, + "address_type_p2sh": 196, + "bech32_prefix": "tbtg", + "blockchain_link": null, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "Bitcoin Gold Testnet", + "coin_name": "Bgold Testnet", + "coin_shortcut": "TBTG", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Economy": 70, + "High": 200, + "Low": 10, + "Normal": 140 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": true, + "fork_id": 79, + "hash_genesis_block": "00000000e0781ebe24b91eedc293adfea2f557b53ec379e78959de3853e6f9f6", + "is_testnet": true, + "max_address_length": 34, + "maxfee_kb": 500000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Bitcoin Gold Testnet", + "overwintered": false, + "segwit": true, + "shortcut": "TBTG", + "signed_message_header": "Bitcoin Gold Signed Message:\n", + "slip44": 1, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.7.1", + "trezor2": "2.0.8" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 70615956, + "xpub_magic": 70617039, + "xpub_magic_multisig_segwit_native": 70617039, + "xpub_magic_multisig_segwit_p2sh": 70617039, + "xpub_magic_segwit_native": 73342198, + "xpub_magic_segwit_p2sh": 71979618 + }, + { + "address_type": 4901, + "address_type_p2sh": 5039, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Bitcoin Private", + "coin_name": "Bprivate", + "coin_shortcut": "BTCP", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": 42, + "hash_genesis_block": "0007104ccda289427919efc39dc9e4d499804b7bebc22df55f8b834301260602", + "is_testnet": false, + "max_address_length": 95, + "maxfee_kb": 32000000000, + "min_address_length": 35, + "minfee_kb": 1000, + "name": "Bitcoin Private", + "overwintered": false, + "segwit": false, + "shortcut": "BTCP", + "signed_message_header": "BitcoinPrivate Signed Message:\n", + "slip44": 183, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 3, + "address_type_p2sh": 125, + "bech32_prefix": "btx", + "blockchain_link": null, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Bitcore", + "coin_name": "Bitcore", + "coin_shortcut": "BTX", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Low": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "604148281e5c4b7f2487e5d03cd60d8e6f69411d613f6448034508cea52e9574", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 14000000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Bitcore", + "overwintered": false, + "segwit": true, + "shortcut": "BTX", + "signed_message_header": "BitCore Signed Message:\n", + "slip44": 160, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.7.1", + "trezor2": "2.0.8" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 76067358, + "xpub_magic_multisig_segwit_p2sh": 76067358, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 76, + "address_type_p2sh": 16, + "bech32_prefix": null, + "blockchain_link": { + "type": "blockbook", + "url": [ + "https://dash1.trezor.io", + "https://dash2.trezor.io", + "https://dash3.trezor.io", + "https://dash4.trezor.io", + "https://dash5.trezor.io" + ] + }, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Dash", + "coin_name": "Dash", + "coin_shortcut": "DASH", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 5460, + "extra_data": true, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 45000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Dash", + "overwintered": false, + "segwit": false, + "shortcut": "DASH", + "signed_message_header": "DarkCoin Signed Message:\n", + "slip44": 5, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.5.2", + "trezor2": "2.0.5" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 50221816, + "xpub_magic": 50221772, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 140, + "address_type_p2sh": 19, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Dash Testnet", + "coin_name": "Dash Testnet", + "coin_shortcut": "tDASH", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 5460, + "extra_data": true, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c", + "is_testnet": true, + "max_address_length": 34, + "maxfee_kb": 100000, + "min_address_length": 27, + "minfee_kb": 10000, + "name": "Dash Testnet", + "overwintered": false, + "segwit": false, + "shortcut": "tDASH", + "signed_message_header": "DarkCoin Signed Message:\n", + "slip44": 1, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.8" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 70615956, + "xpub_magic": 70617039, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 1855, + "address_type_p2sh": 1818, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 300, + "cashaddr_prefix": null, + "coin_label": "Decred", + "coin_name": "Decred", + "coin_shortcut": "DCR", + "curve_name": "secp256k1_decred", + "decimals": 8, + "decred": true, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980", + "is_testnet": false, + "max_address_length": 35, + "maxfee_kb": 220000000, + "min_address_length": 35, + "minfee_kb": 10000, + "name": "Decred", + "overwintered": false, + "segwit": false, + "shortcut": "DCR", + "signed_message_header": "Decred Signed Message:\n", + "slip44": 42, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.8" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 50177256, + "xpub_magic": 50178342, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 3873, + "address_type_p2sh": 3836, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 120, + "cashaddr_prefix": null, + "coin_label": "Decred Testnet", + "coin_name": "Decred Testnet", + "coin_shortcut": "TDCR", + "curve_name": "secp256k1_decred", + "decimals": 8, + "decred": true, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "a649dce53918caf422e9c711c858837e08d626ecfcd198969b24f7b634a49bac", + "is_testnet": true, + "max_address_length": 35, + "maxfee_kb": 10000000, + "min_address_length": 35, + "minfee_kb": 1000, + "name": "Decred Testnet", + "overwintered": false, + "segwit": false, + "shortcut": "TDCR", + "signed_message_header": "Decred Signed Message:\n", + "slip44": 1, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.8" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 70615959, + "xpub_magic": 70617041, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 30, + "address_type_p2sh": 63, + "bech32_prefix": "dgb", + "blockchain_link": { + "type": "blockbook", + "url": ["https://dgb1.trezor.io", "https://dgb2.trezor.io"] + }, + "blocktime_seconds": 15, + "cashaddr_prefix": null, + "coin_label": "DigiByte", + "coin_name": "DigiByte", + "coin_shortcut": "DGB", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 30 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "7497ea1b465eb39f1c8f507bc877078fe016d6fcb6dfad3a64c98dcc6e1e8496", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 130000000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "DigiByte", + "overwintered": false, + "segwit": true, + "shortcut": "DGB", + "signed_message_header": "DigiByte Signed Message:\n", + "slip44": 20, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.6.3", + "trezor2": "2.0.7" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 76067358, + "xpub_magic_multisig_segwit_p2sh": 76067358, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 30, + "address_type_p2sh": 22, + "bech32_prefix": null, + "blockchain_link": { + "type": "blockbook", + "url": [ + "https://doge1.trezor.io", + "https://doge2.trezor.io", + "https://doge3.trezor.io", + "https://doge4.trezor.io", + "https://doge5.trezor.io" + ] + }, + "blocktime_seconds": 60, + "cashaddr_prefix": null, + "coin_label": "Dogecoin", + "coin_name": "Dogecoin", + "coin_shortcut": "DOGE", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 1000 + }, + "dust_limit": 1000000, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 1200000000000, + "min_address_length": 27, + "minfee_kb": 100000, + "name": "Dogecoin", + "overwintered": false, + "segwit": false, + "shortcut": "DOGE", + "signed_message_header": "Dogecoin Signed Message:\n", + "slip44": 3, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.5.2", + "trezor2": "2.0.5" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 49988504, + "xpub_magic": 49990397, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 14, + "address_type_p2sh": 5, + "bech32_prefix": "fc", + "blockchain_link": null, + "blocktime_seconds": 60, + "cashaddr_prefix": null, + "coin_label": "Feathercoin", + "coin_name": "Feathercoin", + "coin_shortcut": "FTC", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 1000 + }, + "dust_limit": 54600, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 390000000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Feathercoin", + "overwintered": false, + "segwit": true, + "shortcut": "FTC", + "signed_message_header": "Feathercoin Signed Message:\n", + "slip44": 8, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.7.1", + "trezor2": "2.0.8" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76077806, + "xpub_magic": 76069926, + "xpub_magic_multisig_segwit_native": 76069926, + "xpub_magic_multisig_segwit_p2sh": 76069926, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 82, + "address_type_p2sh": 7, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "Firo", + "coin_name": "Firo", + "coin_shortcut": "FIRO", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Economy": 10, + "High": 200, + "Low": 1, + "Normal": 100 + }, + "dust_limit": 546, + "extra_data": true, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "4381deb85b1b2c9843c222944b616d997516dcbd6a964e1eaf0def0830695233", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 640000000, + "min_address_length": 27, + "minfee_kb": 0, + "name": "Firo", + "overwintered": false, + "segwit": false, + "shortcut": "FIRO", + "signed_message_header": "Zcoin Signed Message:\n", + "slip44": 136, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 65, + "address_type_p2sh": 178, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "Firo Testnet", + "coin_name": "Firo Testnet", + "coin_shortcut": "tFIRO", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Economy": 10, + "High": 200, + "Low": 1, + "Normal": 100 + }, + "dust_limit": 546, + "extra_data": true, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "7ac038c193c2158c428c59f9ae0c02a07115141c6e9dc244ae96132e99b4e642", + "is_testnet": true, + "max_address_length": 35, + "maxfee_kb": 1000000, + "min_address_length": 27, + "minfee_kb": 0, + "name": "Firo Testnet", + "overwintered": false, + "segwit": false, + "shortcut": "tFIRO", + "signed_message_header": "Zcoin Signed Message:\n", + "slip44": 1, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 70615956, + "xpub_magic": 70617039, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 35, + "address_type_p2sh": 94, + "bech32_prefix": "flo", + "blockchain_link": null, + "blocktime_seconds": 40, + "cashaddr_prefix": null, + "coin_label": "Flo", + "coin_name": "Florincoin", + "coin_shortcut": "FLO", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 1000 + }, + "dust_limit": 546, + "extra_data": true, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "09c7781c9df90708e278c35d38ea5c9041d7ecfcdd1c56ba67274b7cff3e1cea", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 78000000000, + "min_address_length": 27, + "minfee_kb": 100000, + "name": "Flo", + "overwintered": false, + "segwit": true, + "shortcut": "FLO", + "signed_message_header": "Florincoin Signed Message:\n", + "slip44": 216, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.7.2", + "trezor2": "2.0.11" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 15264107, + "xpub_magic": 1526049, + "xpub_magic_multisig_segwit_native": 1526049, + "xpub_magic_multisig_segwit_p2sh": 1526049, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 28471030 + }, + { + "address_type": 36, + "address_type_p2sh": 16, + "bech32_prefix": "fc", + "blockchain_link": { + "type": "blockbook", + "url": ["https://explorer.fujicoin.org"] + }, + "blocktime_seconds": 60, + "cashaddr_prefix": null, + "coin_label": "Fujicoin", + "coin_name": "Fujicoin", + "coin_shortcut": "FJC", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Economy": 20000, + "High": 100000, + "Low": 10000, + "Normal": 50000 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "adb6d9cfd74075e7f91608add4bd2a2ea636f70856183086842667a1597714a0", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 35000000000000, + "min_address_length": 27, + "minfee_kb": 10000000, + "name": "Fujicoin", + "overwintered": false, + "segwit": true, + "shortcut": "FJC", + "signed_message_header": "FujiCoin Signed Message:\n", + "slip44": 75, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.1", + "trezor2": "2.0.5" + }, + "taproot": true, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 44728019, + "xpub_magic_multisig_segwit_p2sh": 43365439, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 60, + "address_type_p2sh": 85, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 60, + "cashaddr_prefix": null, + "coin_label": "Komodo", + "coin_name": "Komodo", + "coin_shortcut": "KMD", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": true, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 4800000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Komodo", + "overwintered": true, + "segwit": false, + "shortcut": "KMD", + "signed_message_header": "Komodo Signed Message:\n", + "slip44": 141, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.0", + "trezor2": "2.0.11" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 6198, + "address_type_p2sh": 6203, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 60, + "cashaddr_prefix": null, + "coin_label": "Koto", + "coin_name": "Koto", + "coin_shortcut": "KOTO", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": true, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "6d424c350729ae633275d51dc3496e16cd1b1d195c164da00f39c499a2e9959e", + "is_testnet": false, + "max_address_length": 95, + "maxfee_kb": 1000000, + "min_address_length": 35, + "minfee_kb": 1000, + "name": "Koto", + "overwintered": true, + "segwit": false, + "shortcut": "KOTO", + "signed_message_header": "Koto Signed Message:\n", + "slip44": 510, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.7.1", + "trezor2": "2.0.8" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 48, + "address_type_p2sh": 50, + "bech32_prefix": "ltc", + "blockchain_link": { + "type": "blockbook", + "url": [ + "https://ltc1.trezor.io", + "https://ltc2.trezor.io", + "https://ltc3.trezor.io", + "https://ltc4.trezor.io", + "https://ltc5.trezor.io" + ] + }, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Litecoin", + "coin_name": "Litecoin", + "coin_shortcut": "LTC", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 1000 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 67000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Litecoin", + "overwintered": false, + "segwit": true, + "shortcut": "LTC", + "signed_message_header": "Litecoin Signed Message:\n", + "slip44": 2, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.5.2", + "trezor2": "2.0.5" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 27106558, + "xpub_magic": 27108450, + "xpub_magic_multisig_segwit_native": 27108450, + "xpub_magic_multisig_segwit_p2sh": 27108450, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 28471030 + }, + { + "address_type": 111, + "address_type_p2sh": 58, + "bech32_prefix": "tltc", + "blockchain_link": null, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Litecoin Testnet", + "coin_name": "Litecoin Testnet", + "coin_shortcut": "tLTC", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 54600, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "4966625a4b2851d9fdee139e56211a0d88575f59ed816ff5e6a63deb4e3e29a0", + "is_testnet": true, + "max_address_length": 34, + "maxfee_kb": 40000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Litecoin Testnet", + "overwintered": false, + "segwit": true, + "shortcut": "tLTC", + "signed_message_header": "Litecoin Signed Message:\n", + "slip44": 1, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 70615956, + "xpub_magic": 70617039, + "xpub_magic_multisig_segwit_native": 70617039, + "xpub_magic_multisig_segwit_p2sh": 70617039, + "xpub_magic_segwit_native": 73342198, + "xpub_magic_segwit_p2sh": 71979618 + }, + { + "address_type": 50, + "address_type_p2sh": 55, + "bech32_prefix": "mona", + "blockchain_link": { + "type": "blockbook", + "url": ["https://blockbook.electrum-mona.org"] + }, + "blocktime_seconds": 90, + "cashaddr_prefix": null, + "coin_label": "Monacoin", + "coin_name": "Monacoin", + "coin_shortcut": "MONA", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 1000 + }, + "dust_limit": 54600, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "ff9f1c0116d19de7c9963845e129f9ed1bfc0b376eb54fd7afa42e0d418c8bb6", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 2100000000, + "min_address_length": 27, + "minfee_kb": 100000, + "name": "Monacoin", + "overwintered": false, + "segwit": true, + "shortcut": "MONA", + "signed_message_header": "Monacoin Signed Message:\n", + "slip44": 22, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.0", + "trezor2": "2.0.5" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 76067358, + "xpub_magic_multisig_segwit_p2sh": 76067358, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 52, + "address_type_p2sh": 5, + "bech32_prefix": null, + "blockchain_link": { + "type": "blockbook", + "url": ["https://nmc1.trezor.io", "https://nmc2.trezor.io"] + }, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "Namecoin", + "coin_name": "Namecoin", + "coin_shortcut": "NMC", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 2940, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "000000000062b72c5e2ceb45fbc8587e807c155b0da735e6483dfba2f0a9c770", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 8700000000, + "min_address_length": 27, + "minfee_kb": 100000, + "name": "Namecoin", + "overwintered": false, + "segwit": false, + "shortcut": "NMC", + "signed_message_header": "Namecoin Signed Message:\n", + "slip44": 7, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.5.2", + "trezor2": "2.0.5" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 55, + "address_type_p2sh": 117, + "bech32_prefix": "pc", + "blockchain_link": { + "type": "blockbook", + "url": ["https://blockbook.peercoin.net"] + }, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "Peercoin", + "coin_name": "Peercoin", + "coin_shortcut": "PPC", + "curve_name": "secp256k1", + "decimals": 6, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 10000, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "0000000032fe677166d54963b62a4677d8957e87c508eaa4fd7eb1c880cd27e3", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 13000000000, + "min_address_length": 27, + "minfee_kb": 10000, + "name": "Peercoin", + "overwintered": false, + "segwit": true, + "shortcut": "PPC", + "signed_message_header": "Peercoin Signed Message:\n", + "slip44": 6, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.4", + "trezor2": "2.1.9" + }, + "taproot": false, + "timestamp": true, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 76067358, + "xpub_magic_multisig_segwit_p2sh": 76067358, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 111, + "address_type_p2sh": 196, + "bech32_prefix": "tpc", + "blockchain_link": { + "type": "blockbook", + "url": ["https://tblockbook.peercoin.net"] + }, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "Peercoin Testnet", + "coin_name": "Peercoin Testnet", + "coin_shortcut": "tPPC", + "curve_name": "secp256k1", + "decimals": 6, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 10000, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "00000001f757bb737f6596503e17cd17b0658ce630cc727c0cca81aec47c9f06", + "is_testnet": true, + "max_address_length": 34, + "maxfee_kb": 2000000, + "min_address_length": 27, + "minfee_kb": 10000, + "name": "Peercoin Testnet", + "overwintered": false, + "segwit": true, + "shortcut": "tPPC", + "signed_message_header": "Peercoin Signed Message:\n", + "slip44": 1, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.4", + "trezor2": "2.1.9" + }, + "taproot": false, + "timestamp": true, + "xprv_magic": 70615956, + "xpub_magic": 70617039, + "xpub_magic_multisig_segwit_native": 70617039, + "xpub_magic_multisig_segwit_p2sh": 70617039, + "xpub_magic_segwit_native": 73342198, + "xpub_magic_segwit_p2sh": 71979618 + }, + { + "address_type": 23, + "address_type_p2sh": 83, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 60, + "cashaddr_prefix": null, + "coin_label": "Primecoin", + "coin_name": "Primecoin", + "coin_shortcut": "XPM", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "963d17ba4dc753138078a2f56afb3af9674e2546822badff26837db9a0152106", + "is_testnet": false, + "max_address_length": 35, + "maxfee_kb": 89000000000, + "min_address_length": 26, + "minfee_kb": 1000, + "name": "Primecoin", + "overwintered": false, + "segwit": false, + "shortcut": "XPM", + "signed_message_header": "Primecoin Signed Message:\n", + "slip44": 24, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.0", + "trezor2": "2.0.11" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 60, + "address_type_p2sh": 122, + "bech32_prefix": null, + "blockchain_link": { + "type": "blockbook", + "url": ["https://blockbook.ravencoin.org"] + }, + "blocktime_seconds": 60, + "cashaddr_prefix": null, + "coin_label": "Ravencoin", + "coin_name": "Ravencoin", + "coin_shortcut": "RVN", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Low": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "0000006b444bc2f2ffe627be9d9e7e7a0730000870ef6eb6da46c8eae389df90", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 170000000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Ravencoin", + "overwintered": false, + "segwit": false, + "shortcut": "RVN", + "signed_message_header": "Raven Signed Message:\n", + "slip44": 175, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.7.2", + "trezor2": "2.0.10" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 25, + "address_type_p2sh": 105, + "bech32_prefix": null, + "blockchain_link": { + "type": "blockbook", + "url": ["https://blockbook.ritocoin.org"] + }, + "blocktime_seconds": 60, + "cashaddr_prefix": null, + "coin_label": "Ritocoin", + "coin_name": "Ritocoin", + "coin_shortcut": "RITO", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Low": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "00000075e344bdf1c0e433f453764b1830a7aa19b2a5213e707502a22b779c1b", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 39000000000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Ritocoin", + "overwintered": false, + "segwit": false, + "shortcut": "RITO", + "signed_message_header": "Rito Signed Message:\n", + "slip44": 19169, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.2", + "trezor2": "2.1.1" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 87326380, + "xpub_magic": 87353290, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 76, + "address_type_p2sh": 16, + "bech32_prefix": "xc", + "blockchain_link": null, + "blocktime_seconds": 60, + "cashaddr_prefix": null, + "coin_label": "Stakenet", + "coin_name": "Stakenet", + "coin_shortcut": "XSN", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Economy": 70, + "High": 200, + "Low": 10, + "Normal": 140 + }, + "dust_limit": 1000, + "extra_data": true, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "00000c822abdbb23e28f79a49d29b41429737c6c7e15df40d1b1f1b35907ae34", + "is_testnet": false, + "max_address_length": 47, + "maxfee_kb": 11000000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Stakenet", + "overwintered": false, + "segwit": true, + "shortcut": "XSN", + "signed_message_header": "DarkCoin Signed Message:\n", + "slip44": 199, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.0", + "trezor2": "2.0.11" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 76067358, + "xpub_magic_multisig_segwit_p2sh": 76067358, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 63, + "address_type_p2sh": 5, + "bech32_prefix": "sys", + "blockchain_link": { + "type": "blockbook", + "url": ["https://blockbook.elint.services"] + }, + "blocktime_seconds": 60, + "cashaddr_prefix": null, + "coin_label": "Syscoin", + "coin_name": "Syscoin", + "coin_shortcut": "SYS", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Economy": 700, + "High": 2000, + "Low": 100, + "Normal": 1400 + }, + "dust_limit": 1820, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "0000022642db0346b6e01c2a397471f4f12e65d4f4251ec96c1f85367a61a7ab", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 42000000000, + "min_address_length": 27, + "minfee_kb": 10000, + "name": "Syscoin", + "overwintered": false, + "segwit": true, + "shortcut": "SYS", + "signed_message_header": "Syscoin Signed Message:\n", + "slip44": 57, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.4", + "trezor2": "2.1.8" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 76067358, + "xpub_magic_multisig_segwit_p2sh": 76067358, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 130, + "address_type_p2sh": 30, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 30, + "cashaddr_prefix": null, + "coin_label": "Unobtanium", + "coin_name": "Unobtanium", + "coin_shortcut": "UNO", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Economy": 50, + "High": 160, + "Low": 10, + "Normal": 100 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "000004c2fc5fffb810dccc197d603690099a68305232e552d96ccbe8e2c52b75", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 53000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Unobtanium", + "overwintered": false, + "segwit": false, + "shortcut": "UNO", + "signed_message_header": "Unobtanium Signed Message:\n", + "slip44": 92, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.4", + "trezor2": "2.1.6" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 30, + "address_type_p2sh": 33, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 30, + "cashaddr_prefix": null, + "coin_label": "Verge", + "coin_name": "Verge", + "coin_shortcut": "XVG", + "curve_name": "secp256k1", + "decimals": 6, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 10000, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "00000fc63692467faeb20cdb3b53200dc601d75bdfa1001463304cc790d77278", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 550000000000, + "min_address_length": 27, + "minfee_kb": 1000000, + "name": "Verge", + "overwintered": false, + "segwit": false, + "shortcut": "XVG", + "signed_message_header": "Name: Dogecoin Dark\n", + "slip44": 77, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.9.3", + "trezor2": "2.3.3" + }, + "taproot": false, + "timestamp": true, + "xprv_magic": 35729707, + "xpub_magic": 36513075, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 71, + "address_type_p2sh": 5, + "bech32_prefix": "vtc", + "blockchain_link": { + "type": "blockbook", + "url": [ + "https://vtc1.trezor.io", + "https://vtc2.trezor.io", + "https://vtc3.trezor.io", + "https://vtc4.trezor.io", + "https://vtc5.trezor.io" + ] + }, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Vertcoin", + "coin_name": "Vertcoin", + "coin_shortcut": "VTC", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 1000 + }, + "dust_limit": 54600, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "4d96a915f49d40b1e5c2844d1ee2dccb90013a990ccea12c492d22110489f0c4", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 13000000000, + "min_address_length": 27, + "minfee_kb": 100000, + "name": "Vertcoin", + "overwintered": false, + "segwit": true, + "shortcut": "VTC", + "signed_message_header": "Vertcoin Signed Message:\n", + "slip44": 28, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.6.1", + "trezor2": "2.0.5" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 76067358, + "xpub_magic_multisig_segwit_p2sh": 76067358, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 71, + "address_type_p2sh": 33, + "bech32_prefix": "via", + "blockchain_link": null, + "blocktime_seconds": 24, + "cashaddr_prefix": null, + "coin_label": "Viacoin", + "coin_name": "Viacoin", + "coin_shortcut": "VIA", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Economy": 7000, + "High": 20000, + "Low": 1000, + "Normal": 14000 + }, + "dust_limit": 54600, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "4e9b54001f9976049830128ec0331515eaabe35a70970d79971da1539a400ba1", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 14000000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "Viacoin", + "overwintered": false, + "segwit": true, + "shortcut": "VIA", + "signed_message_header": "Viacoin Signed Message:\n", + "slip44": 14, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": 76067358, + "xpub_magic_multisig_segwit_p2sh": 76067358, + "xpub_magic_segwit_native": 78792518, + "xpub_magic_segwit_p2sh": 77429938 + }, + { + "address_type": 142, + "address_type_p2sh": 145, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 120, + "cashaddr_prefix": null, + "coin_label": "ZCore", + "coin_name": "ZCore", + "coin_shortcut": "ZCR", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "695b79c8c234b45b2eeb4722f33373e471c9b686ff78efeb39da95f824a9f81b", + "is_testnet": false, + "max_address_length": 95, + "maxfee_kb": 170000000000, + "min_address_length": 34, + "minfee_kb": 1000, + "name": "ZCore", + "overwintered": false, + "segwit": false, + "shortcut": "ZCR", + "signed_message_header": "DarkNet Signed Message:\n", + "slip44": 428, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.4", + "trezor2": "2.1.7" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 78791432, + "xpub_magic": 78792518, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 7352, + "address_type_p2sh": 7357, + "bech32_prefix": null, + "blockchain_link": { + "type": "blockbook", + "url": [ + "https://zec1.trezor.io", + "https://zec2.trezor.io", + "https://zec3.trezor.io", + "https://zec4.trezor.io", + "https://zec5.trezor.io" + ] + }, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Zcash", + "coin_name": "Zcash", + "coin_shortcut": "ZEC", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": true, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08", + "is_testnet": false, + "max_address_length": 95, + "maxfee_kb": 51000000, + "min_address_length": 35, + "minfee_kb": 1000, + "name": "Zcash", + "overwintered": true, + "segwit": false, + "shortcut": "ZEC", + "signed_message_header": "Zcash Signed Message:\n", + "slip44": 133, + "support": { + "connect": true, + "suite": true, + "trezor1": "1.8.1", + "trezor2": "2.1.1" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 7461, + "address_type_p2sh": 7354, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 150, + "cashaddr_prefix": null, + "coin_label": "Zcash Testnet", + "coin_name": "Zcash Testnet", + "coin_shortcut": "TAZ", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Normal": 10 + }, + "dust_limit": 546, + "extra_data": true, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "05a60a92d99d85997cce3b87616c089f6124d7342af37106edc76126334a2c38", + "is_testnet": true, + "max_address_length": 95, + "maxfee_kb": 10000000, + "min_address_length": 35, + "minfee_kb": 1000, + "name": "Zcash Testnet", + "overwintered": true, + "segwit": false, + "shortcut": "TAZ", + "signed_message_header": "Zcash Signed Message:\n", + "slip44": 1, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.1", + "trezor2": "2.1.1" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 70615956, + "xpub_magic": 70617039, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + }, + { + "address_type": 61, + "address_type_p2sh": 123, + "bech32_prefix": null, + "blockchain_link": null, + "blocktime_seconds": 600, + "cashaddr_prefix": null, + "coin_label": "xRhodium", + "coin_name": "Brhodium", + "coin_shortcut": "XRC", + "curve_name": "secp256k1", + "decimals": 8, + "decred": false, + "default_fee_b": { + "Economy": 70, + "High": 200, + "Low": 10, + "Normal": 140 + }, + "dust_limit": 546, + "extra_data": false, + "force_bip143": false, + "fork_id": null, + "hash_genesis_block": "baff5bfd9dc43fb672d003ec20fd21428f9282ca46bfa1730d73e1f2c75f5fdd", + "is_testnet": false, + "max_address_length": 34, + "maxfee_kb": 1000000000, + "min_address_length": 27, + "minfee_kb": 1000, + "name": "xRhodium", + "overwintered": false, + "segwit": false, + "shortcut": "XRC", + "signed_message_header": "BitCoin Rhodium Signed Message:\n", + "slip44": 10291, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.8.2", + "trezor2": "2.1.1" + }, + "taproot": false, + "timestamp": false, + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_multisig_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_segwit_p2sh": null + } + ], + "misc": [ + { + "blockchain_link": { + "type": "blockfrost", + "url": ["wss://trezor-cardano-mainnet.blockfrost.io"] + }, + "curve": "ed25519", + "decimals": 6, + "is_testnet": false, + "name": "Cardano", + "shortcut": "ADA", + "slip44": 1815, + "support": { + "connect": true, + "suite": false, + "trezor1": false, + "trezor2": "2.0.8" + } + }, + { + "blockchain_link": null, + "curve": "secp256k1", + "decimals": 8, + "is_testnet": false, + "name": "Binance Chain", + "shortcut": "BNB", + "slip44": 714, + "support": { + "connect": true, + "suite": false, + "trezor1": false, + "trezor2": "2.1.5" + } + }, + { + "blockchain_link": null, + "curve": "secp256k1", + "decimals": 4, + "is_testnet": false, + "name": "EOS", + "shortcut": "EOS", + "slip44": 194, + "support": { + "connect": true, + "suite": false, + "trezor1": false, + "trezor2": "2.1.1" + } + }, + { + "blockchain_link": { + "type": "blockfrost", + "url": ["wss://trezor-cardano-preview.blockfrost.io"] + }, + "curve": "ed25519", + "decimals": 6, + "is_testnet": false, + "name": "Cardano Preview Testnet", + "shortcut": "tADA", + "slip44": 1815, + "support": { + "connect": true, + "suite": false, + "trezor1": false, + "trezor2": "2.0.8" + } + }, + { + "blockchain_link": { + "type": "ripple", + "url": ["wss://s.altnet.rippletest.net"] + }, + "curve": "secp256k1", + "decimals": 6, + "is_testnet": false, + "name": "Ripple Testnet", + "shortcut": "tXRP", + "slip44": 1, + "support": { + "connect": true, + "suite": true, + "trezor1": false, + "trezor2": "2.0.8" + } + }, + { + "blockchain_link": null, + "curve": "ed25519", + "decimals": 7, + "is_testnet": false, + "name": "Stellar", + "shortcut": "XLM", + "slip44": 148, + "support": { + "connect": true, + "suite": false, + "trezor1": "1.7.1", + "trezor2": "2.0.8" + } + }, + { + "blockchain_link": { + "type": "ripple", + "url": ["wss://s1.ripple.com", "wss://s-east.ripple.com", "wss://s-west.ripple.com"] + }, + "curve": "secp256k1", + "decimals": 6, + "is_testnet": false, + "name": "Ripple", + "shortcut": "XRP", + "slip44": 144, + "support": { + "connect": true, + "suite": true, + "trezor1": false, + "trezor2": "2.0.8" + } + }, + { + "blockchain_link": null, + "curve": "ed25519", + "decimals": 6, + "is_testnet": false, + "name": "Tezos", + "shortcut": "XTZ", + "slip44": 1729, + "support": { + "connect": true, + "suite": false, + "trezor1": false, + "trezor2": "2.0.8" + } + } + ], + "nem": [ + { + "blockchain_link": null, + "divisibility": 6, + "is_testnet": false, + "mosaic": "xem", + "name": "NEM", + "namespace": "nem", + "shortcut": "XEM", + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "ticker": "XEM" + }, + { + "blockchain_link": null, + "divisibility": 6, + "fee": 10, + "is_testnet": false, + "levy": "MosaicLevy_Percentile", + "levy_mosaic": "coin", + "levy_namespace": "dim", + "mosaic": "coin", + "name": "DIMCOIN", + "namespace": "dim", + "networks": [104], + "shortcut": "DIM", + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "ticker": "DIM" + }, + { + "blockchain_link": null, + "divisibility": 6, + "is_testnet": false, + "mosaic": "token", + "name": "DIM TOKEN", + "namespace": "dim", + "networks": [104], + "shortcut": "DIMTOK", + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "ticker": "DIMTOK" + }, + { + "blockchain_link": null, + "divisibility": 0, + "is_testnet": false, + "mosaic": "breeze-token", + "name": "Breeze Token", + "namespace": "breeze", + "networks": [104], + "shortcut": "BREEZE", + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "ticker": "BREEZE" + }, + { + "blockchain_link": null, + "divisibility": 0, + "is_testnet": false, + "mosaic": "heart", + "name": "PacNEM Game Credits", + "namespace": "pacnem", + "networks": [104], + "shortcut": "PAC:HRT", + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "ticker": "PAC:HRT" + }, + { + "blockchain_link": null, + "divisibility": 6, + "fee": 100, + "is_testnet": false, + "levy": "MosaicLevy_Percentile", + "levy_mosaic": "xem", + "levy_namespace": "nem", + "mosaic": "cheese", + "name": "PacNEM Score Tokens", + "namespace": "pacnem", + "networks": [104], + "shortcut": "PAC:CHS", + "support": { + "connect": true, + "suite": false, + "trezor1": "1.6.2", + "trezor2": "2.0.7" + }, + "ticker": "PAC:CHS" + } + ] +} diff --git a/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-1.12.1.bin b/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-1.12.1.bin new file mode 100644 index 0000000000..9af34e8d64 Binary files /dev/null and b/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-1.12.1.bin differ diff --git a/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-inter-v1.bin b/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-inter-v1.bin new file mode 100644 index 0000000000..ca41611a69 Binary files /dev/null and b/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-inter-v1.bin differ diff --git a/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-inter-v2.bin b/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-inter-v2.bin new file mode 100644 index 0000000000..648f8f77de Binary files /dev/null and b/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-inter-v2.bin differ diff --git a/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-inter-v3.bin b/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-inter-v3.bin new file mode 100644 index 0000000000..f164793ddd Binary files /dev/null and b/app/trezor-prebuild/build/data/devkit/firmware/1/trezor-inter-v3.bin differ diff --git a/app/trezor-prebuild/build/data/devkit/firmware/2/trezor_2.1.0.bin b/app/trezor-prebuild/build/data/devkit/firmware/2/trezor_2.1.0.bin new file mode 100644 index 0000000000..61a758759b Binary files /dev/null and b/app/trezor-prebuild/build/data/devkit/firmware/2/trezor_2.1.0.bin differ diff --git a/app/trezor-prebuild/build/data/firmware/1/releases.json b/app/trezor-prebuild/build/data/firmware/1/releases.json new file mode 100644 index 0000000000..eda4dd1b81 --- /dev/null +++ b/app/trezor-prebuild/build/data/firmware/1/releases.json @@ -0,0 +1,508 @@ +[ + { + "required": false, + "version": [1, 12, 1], + "bootloader_version": [1, 12, 1], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 12, 0], + "min_bootloader_version": [1, 12, 0], + "url": "firmware/1/trezor-1.12.1.bin", + "url_bitcoinonly": "firmware/1/trezor-1.12.1-bitcoinonly.bin", + "fingerprint": "3c694191f5b66a65cb5bb209adbf113cb40209e644b77162ba996bb7ee8f382b", + "fingerprint_bitcoinonly": "985fb6a8c87f7547fb810f6c4a8331ebf19c677445810358778eb21eca78a181", + "notes": "https://trezor.io/learn/a/trezor-device-firmware-update-march-2023", + "changelog": "* Fee rate shown when replacing transaction.\n* Ledger Live legacy derivation path m/44'/coin_type'/0'/account is now supported.\n* SLIP-0019 proofs of ownership for native SegWit implemented.\n* SLIP-0025 coinjoin accounts implemented for testing purposes.\n* Bech32 addresses now not converting to uppercase in QR code to increase compatibility.\n* Decimals of fee rate extended to 2 digits.\n* Only \"sat\" displayed instead of \"sat BTC\".\n* Bootloader 1.12.1. included.\n* Stellar addresses now shown in full + as a QR code.\n* Ethereum fees now wrapped to the next line when needed." + }, + { + "required": false, + "version": [1, 11, 2], + "bootloader_version": [1, 11, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.11.2.bin", + "url_bitcoinonly": "firmware/1/trezor-1.11.2-bitcoinonly.bin", + "fingerprint": "d8b55b68dfe8a8449ce7391e841073ef5d29349638d85b750508bbef5d2de5ec", + "fingerprint_bitcoinonly": "7e51546f4411ecf44688c681ada72a18495fd08e91f3a0429ab91bc4415b362a", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-august-2022-a4e3d76214c1", + "changelog": "* Show the fee rate on the signing confirmation screen. \n* Show thousands separator when displaying large amounts \n* Fix potential security issues in recovery workflow. \n* Fix key extraction vulnerability in Cothority Collective Signing (CoSi). \n* Fix nonce bias in CoSi signing." + }, + { + "required": false, + "version": [1, 11, 1], + "bootloader_version": [1, 11, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.11.1.bin", + "url_bitcoinonly": "firmware/1/trezor-1.11.1-bitcoinonly.bin", + "fingerprint": "f7c60d0b8c2853afd576867c6562aba5ea52bdc2ce34d0dbb8751f52867c3665", + "fingerprint_bitcoinonly": "8e17b95b5d302f203de3a8fe27959efd25e3d5140ac9b5e60412f1b3f624995d", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-may-2022-b1af60742291", + "changelog": "* Support Electrum signatures in VerifyMessage.\n* Trezor will refuse to sign UTXOs that do not match the provided derivation path (e.g., transactions belonging to a different wallet, or synthetic transaction inputs).\n* Zcash v5 transaction format." + }, + { + "required": false, + "version": [1, 10, 5], + "bootloader_version": [1, 10, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.10.5.bin", + "url_bitcoinonly": "firmware/1/trezor-1.10.5-bitcoinonly.bin", + "fingerprint": "7619fcc73c43ca8a3e6aad3dc3eb6551fed05bb218340efe01a02bb96e9f346b", + "fingerprint_bitcoinonly": "1d319f643fe2ba5c247b178c7f73b989ab4e43d914a60468566ee7cc5bb9dde0", + "notes": "https://blog.trezor.io/trezor-suite-update-january-2022-4a77e4a07a5a", + "changelog": "* Support for blindly signing EIP-712 data." + }, + { + "required": false, + "version": [1, 10, 4], + "bootloader_version": [1, 10, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.10.4.bin", + "url_bitcoinonly": "firmware/1/trezor-1.10.4-bitcoinonly.bin", + "fingerprint": "74dfdfb9addb9d90fedb2c88794b7236af521d21ef0096f9080c25b597c8af86", + "fingerprint_bitcoinonly": "30d858b022e218f27854f071d568e5a696c937f1316d83b93aadcd178f3b0a38", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-december-2021-d1e74c3ea283", + "changelog": "* Support Taproot.\n* Show address confirmation in SignMessage.\n* Support for Ethereum EIP-1559 transactions." + }, + { + "required": false, + "version": [1, 10, 3], + "bootloader_version": [1, 10, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.10.3.bin", + "url_bitcoinonly": "firmware/1/trezor-1.10.3-bitcoinonly.bin", + "fingerprint": "bf0cc936a9afbf0a4ae7b727a2817fb69fba432d7230a0ff7b79b4a73b845197", + "fingerprint_bitcoinonly": "d1143d2cba9c7dba4d57703d2b7da87859d8668472ffc651177ead6b94e89117", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-september-2021-a490f2ea16c1", + "changelog": "* Remove Lisk.\n* Re-enabled Firo support.\n* Stricter protobuf field handling in Stellar." + }, + { + "required": false, + "version": [1, 10, 2], + "bootloader_version": [1, 10, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.10.2.bin", + "url_bitcoinonly": "firmware/1/trezor-1.10.2-bitcoinonly.bin", + "fingerprint": "99707b90a504f7e402f26c3d59cbbdacbc52754cebcce79cc47be528fc889338", + "fingerprint_bitcoinonly": "e597b6aef5a2e817f532d27b8501f99f189e432a887877bdd3498cd3a0afc431", + "notes": "https://blog.trezor.io/trezor-suite-launches-8958c1d37d33", + "changelog": "* Security improvements." + }, + { + "required": false, + "version": [1, 10, 1], + "bootloader_version": [1, 10, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.10.1.bin", + "url_bitcoinonly": "firmware/1/trezor-1.10.1-bitcoinonly.bin", + "fingerprint": "36400becf1cdddec22b8150d56ff59eef76d37fef60dc465a6f82b4858903886", + "fingerprint_bitcoinonly": "74227362016a8763c4d5f5b06eeb7eabe5fbd7ed05798b586cc7f4bfef50d7fe", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-june-2021-c70aba9f0e3f", + "changelog": "* Safety checks setting in T1B1." + }, + { + "required": false, + "version": [1, 10, 0], + "bootloader_version": [1, 10, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.10.0.bin", + "url_bitcoinonly": "firmware/1/trezor-1.10.0-bitcoinonly.bin", + "fingerprint": "595ba3e8e887cba185e03098f9538e18164f72f9fc82445e691abcd03e5cf0a4", + "fingerprint_bitcoinonly": "20a4068c34ff6dd7d8c510350409376cf7ea744ba668fdcf16da8f1d81fed289", + "notes": "https://blog.trezor.io/trezor-firmware-updates-may-2021-b11f6d52a65b", + "changelog": "* Bootloader 1.10.0.\n* Allow decreasing the output value in RBF transactions.\n* Support long PIN of up to 50 digits.\n* Display nLockTime in human-readable form." + }, + { + "required": false, + "version": [1, 9, 4], + "bootloader_version": [1, 8, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.9.4.bin", + "url_bitcoinonly": "firmware/1/trezor-1.9.4-bitcoinonly.bin", + "fingerprint": "867017bd784cc4e9ce6f0875c61ea86f89b19380d54045c34608b85472998000", + "fingerprint_bitcoinonly": "3f73dfbcfc48f66c8814f6562524d81888230e0acd1c19b52b6e8772c6c67e7f", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-rbf-and-spending-now-live-c2f69c42d7f7", + "changelog": "* Replacement transaction signing for replace-by-fee.\n* Support for Output Descriptors export.\n* Show Ypub/Zpub correctly for multisig GetAddress.\n* Show amounts in mBTC, uBTC and sat denominations." + }, + { + "required": false, + "version": [1, 9, 3], + "bootloader_version": [1, 8, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.9.3.bin", + "url_bitcoinonly": "firmware/1/trezor-1.9.3-bitcoinonly.bin", + "fingerprint": "2589f456559f813d1149be1022e62f2d48fbe28f4d02de933bd888d91035cace", + "fingerprint_bitcoinonly": "76f899d60ffd9685713cb420d017565c05c43aadaf0e62b645a50a8db69afef6", + "notes": "https://blog.trezor.io/firmware-updates-for-trezor-model-t-version-2-3-3-and-trezor-model-one-version-1-9-3-c94f7a3b6fea", + "changelog": "* Improves the Passphrase feature by showing the entered passphrase on the Trezor screen before opening the wallet.\n* Adds support for Verge (XVG).\n* Drops support for Metaverse (ETP), GINcoin (GIN), Pesetacoin (PTC), and Zel (ZEL).\n* Re-enables spending coins from Bitcoin paths (fixing some compatibility issues with Bitcoin Cash wallets).\n* Fixes smaller issues in the user interface." + }, + { + "required": false, + "version": [1, 9, 2], + "bootloader_version": [1, 8, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.9.2.bin", + "url_bitcoinonly": "firmware/1/trezor-1.9.2-bitcoinonly.bin", + "fingerprint": "45b83acd1330ddfd5567edbae5ff8028df1c48a493f01d47cc5499ee0be9b991", + "fingerprint_bitcoinonly": "2762c0ff78c96e23d1d348330e0a3cdf45d83c8fc8c2d48853b7cb602ddc19bb", + "notes": "https://blog.trezor.io/firmware-updates-for-trezor-model-t-version-2-3-2-and-trezor-model-one-version-1-9-2-f4f9c0f1ed7c", + "changelog": "* Reintroduces the ability to spend pre-Overwinter (2018) funds on Zcash-like coins.\n* Adds support for multiple change outputs in outgoing transactions.\n* Adds a security check to prevent potential issues with paths used in altcoin transactions." + }, + { + "required": false, + "version": [1, 9, 1], + "bootloader_version": [1, 8, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.9.1.bin", + "url_bitcoinonly": "firmware/1/trezor-1.9.1-bitcoinonly.bin", + "fingerprint": "30cde253c46d4fc705f98634a35d06a494cf2a36824622a9c6a573e07f14292d", + "fingerprint_bitcoinonly": "ee743e3bd1e424ceb45a1d877a5422e7af449706f636c459cdd8bb0d4796cba5", + "notes": "https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd", + "changelog": "* Refactor Bitcoin signing" + }, + { + "required": false, + "version": [1, 9, 0], + "bootloader_version": [1, 8, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.9.0.bin", + "url_bitcoinonly": "firmware/1/trezor-1.9.0-bitcoinonly.bin", + "fingerprint": "1f40d1e68f9d182888b5b60da5209eff047ec68fcc96a5c9b61b0e55dd07d458", + "fingerprint_bitcoinonly": "93a670dd20d044bf76cfce6eecd2a85918acdebe616229dbb31250fd03a33870", + "notes": "https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-0-and-trezor-model-t-version-2-3-0-46deb141fc09", + "changelog": "* Introduce Wipe Code\n* Introduce passphrase cache" + }, + { + "required": false, + "version": [1, 8, 3], + "bootloader_version": [1, 8, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.8.3.bin", + "url_bitcoinonly": "firmware/1/trezor-1.8.3-bitcoinonly.bin", + "fingerprint": "496aecfab867504b2283a9f057a0b2fd9d17970a22c81f6ad74232e7b914ce68", + "fingerprint_bitcoinonly": "13d6089cb935f453eaddbfe193e0ab37924a7aa66f684355a4fe5c660c18247a", + "changelog": "* Small code improvements" + }, + { + "required": false, + "version": [1, 8, 2], + "bootloader_version": [1, 8, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.8.2.bin", + "fingerprint": "909742eddcffdc72ca854557962ecad90e97585770f514170abe7a691b0c6eb1", + "changelog": "* Security improvements\n* Fix display of non-divisible OMNI amounts" + }, + { + "required": false, + "version": [1, 8, 1], + "bootloader_version": [1, 8, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.8.1.bin", + "fingerprint": "019e849c1eb285a03a92bbad6d18a328af3b4dc6999722ebb47677b403a4cd16", + "changelog": "* Fix fault when using the device with no PIN* Fix OMNI transactions parsing" + }, + { + "required": false, + "version": [1, 8, 0], + "bootloader_version": [1, 8, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.8.0.bin", + "tags": ["security"], + "fingerprint": "d65f0c07a6a9c53d8b5287798eb53154b33f9e87cd38a3701970e3d0a750a659", + "notes": "https://blog.trezor.io/firmware-updates-for-trezor-one-firmware-1-8-0-and-trezor-model-t-firmware-2-1-0-b9df91e048df", + "changelog": "* Security improvements\n* Upgraded to new storage format\n* Stellar and NEM fixes\n* New coins: ATS, KMD, XPM, XSN, ZCL\n* New ETH tokens" + }, + { + "required": false, + "version": [1, 7, 3], + "bootloader_version": [1, 6, 1], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.7.3.bin", + "fingerprint": "10acc6aa4f24aff36627473b98c23dc4f6d0220d33bc1e09cb572f02410ffdaf", + "changelog": "* Fix USB issue on some Windows 10 installations" + }, + { + "required": false, + "version": [1, 7, 2], + "bootloader_version": [1, 6, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.7.2.bin", + "fingerprint": "4d5c7ac191dba315b2433af27c187925fb713d06984cc6f566231d809dd8d370", + "changelog": "* Add support for OMNI layer: OMNI/MAID/USDT\n* U2F fixes\n* Don't ask for PIN if it has been just set", + "notes": "https://blog.trezor.io/trezor-one-1-7-2-support-for-omni-layer-cbf699e4ffae" + }, + { + "required": false, + "version": [1, 7, 1], + "bootloader_version": [1, 6, 0], + "min_bridge_version": [2, 0, 25], + "min_firmware_version": [1, 6, 2], + "min_bootloader_version": [1, 5, 0], + "url": "firmware/1/trezor-1.7.1.bin", + "fingerprint": "1c303c50bb45d3f35da9e962d8405d0b8e89cc45e122496a48fce3995fa71d48", + "changelog": "* Switch from HID to WebUSB\n* Add support for Stellar\n* Add support for Lisk\n* Add support for Zcash Sapling hardfork\n* Implement seedless setup", + "notes": "https://blog.trezor.io/firmware-updates-moving-from-the-beta-wallet-to-stable-c487931c3596" + }, + { + "required": false, + "version": [1, 6, 3], + "bootloader_version": [1, 5, 1], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.6.3.bin", + "fingerprint": "e8dbb4b7fe8384afd4c99790277c2f2f366a1a0f3957aa3545c75371a99a8fcc", + "changelog": "* Implement RSKIP-60 Ethereum checksum encoding\n* Add support for new Ethereum networks (ESN, AKA, ETHO, MUSI, PIRL, ATH, GO)\n* Add support for new 80 Ethereum tokens\n* Improve MPU configuration", + "notes": "https://blog.trezor.io/trezor-one-firmware-update-1-6-3-73894c0506d" + }, + { + "required": false, + "version": [1, 6, 2], + "bootloader_version": [1, 5, 0], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.6.2.bin", + "fingerprint": "d31304f793854e343df6ccf1804f7e2abf48ddcd82a379ca2d3711d54127e138", + "changelog": "* Add possibility to set custom auto-lock delay\n* Bitcoin Cash cashaddr support\n* Zcash Overwinter hardfork support\n* Support for new coins:\n - Decred, Bitcoin Private, Fujicoin, Groestlcoin, Vertcoin, Viacoin, Zcoin\n* Support for new Ethereum networks:\n - EOS Classic, Ethereum Social, Ellaism, Callisto, EtherGem, Wanchain\n* Support for 500+ new Ethereum tokens", + "notes": "https://blog.trezor.io/june-updates-trezor-devices-one-modelt-wallet-zcash-cashaddr-doge-8d98c2a73036" + }, + { + "required": true, + "version": [1, 6, 1], + "bootloader_version": [1, 4, 0], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.6.1.bin", + "fingerprint": "83c3190a94e524ac83a1704eb584a2ab53f8a65a893b1ab52e7135812857c807", + "changelog": "* Use fixed-width font for addresses\n* Lots of under-the-hood improvements\n* Fixed issue with write-protection settings", + "notes": "https://blog.trezor.io/trezor-one-firmware-update-1-6-1-eecd0534ab95" + }, + { + "required": false, + "version": [1, 6, 0], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.6.0.bin", + "fingerprint": "e40f6ce12724c2d24234a7752953b88fd9ec28b3ec72c0dbfa280095a67a06ca", + "changelog": "* Native SegWit (Bech32) address support\n* Show recognized BIP44/BIP49 paths in GetAddress dialog\n* NEM support\n* Expanse and UBIQ chains support\n* Bitcoin Gold, DigiByte, Monacoin support\n* Ed25519 collective signatures (CoSi) support", + "notes": "https://blog.trezor.io/expanded-cryptos-cryptocurrency-support-firmware-1-6-0-3825b5853470" + }, + { + "required": true, + "version": [1, 5, 2], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.5.2.bin", + "fingerprint": "99f71379dec893fbe109832a1150f338660be686fe6b4903ff10ff751ba4e448", + "changelog": "* clean memory on start\n* fix storage import from older versions", + "notes": "https://blog.trezor.io/trezor-firmware-security-update-1-5-2-5ef1b6f13fed" + }, + { + "required": false, + "version": [1, 5, 1], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.5.1.bin", + "fingerprint": "1c1fa9802cbd6a947a4f3e78f209d3efe49eb4abbacb101bbc3a0a709c742707", + "changelog": "* Wipe storage after 16 wrong PIN attempts\n* Enable Segwit for Bitcoin\n* Bcash aka Bitcoin Cash support\n* Message signing/verification for Ethereum and Segwit\n* Make address dialog nicer (switch text/QR via button)\n* Use checksum for Ethereum addresses\n* Add more ERC-20 tokens, handle unrecognized ERC-20 tokens\n* Allow \"dry run\" recovery procedure\n* Allow separated backup procedure" + }, + { + "required": false, + "version": [1, 5, 0], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.5.0.bin", + "fingerprint": "c4eddafd29b580d8482cda68e61bdcf1740d77520ef3a603758646bbffe957ea", + "changelog": "* Enable Segwit for Testnet and Litecoin\n* Enable ERC-20 tokens for Ethereum chains" + }, + { + "required": false, + "version": [1, 4, 2], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.4.2.bin", + "fingerprint": "a4b39f01bd134d01d7534821445bf779dbe6c25f0fcf7c7cb285a79b17f25e0a", + "changelog": "* New Matrix-based recovery method\n* Minor Ethereum fixes (including EIP-155 replay protection)\n* Minor USB, U2F and GPG fixes" + }, + { + "required": false, + "version": [1, 4, 1], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.4.1.bin", + "fingerprint": "92636493f76f352213e681bbc26eb3a8844f7b8a3044214b65c3c2c10a0f788c", + "changelog": "* Support for Zcash JoinSplit transactions\n* Enable device lock after 10 minutes of inactivity\n* Enable device lock by pressing left button for 2 seconds\n* Confirm dialog for U2F counter change" + }, + { + "required": false, + "version": [1, 4, 0], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.4.0.bin", + "fingerprint": "5764715dbcf8ed88bc0ae1c2f715277f22b67f26c15e1f7543b2b44913b5c255", + "changelog": "* U2F support\n* Ethereum support\n* GPG decryption support\n* Zcash support", + "notes": "https://blog.trezor.io/secure-two-factor-authentication-with-trezor-u2f-e940fd5a60af" + }, + { + "required": false, + "version": [1, 3, 6], + "min_bridge_version": [1, 1, 5], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.3.6.bin", + "fingerprint": "03b559a758961b2bfd4443e6c36c10025268cf033ecd376fdd7a79ff658bf511", + "changelog": "* Enable advanced transactions such as ones with REPLACE-BY-FEE and CHECKLOCKTIMEVERIFY\n* Fix message signing for altcoins\n* Message verification now shows address\n* Enable GPG signing support\n* Enable Ed25519 curve (for SSH and GPG)\n* Use separate deterministic hierarchy for NIST256P1 and Ed25519 curves\n* Users using SSH already need to regenerate their keys using the new firmware!!!", + "notes": "https://blog.trezor.io/trezor-firmware-1-3-6-20a7df6e692" + }, + { + "required": false, + "version": [1, 3, 5], + "min_bridge_version": [1, 1, 2], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.3.5.bin", + "fingerprint": "7d5d2c7defb93081a7fb7a2d1e57677fbac2a3e3e50f22fa3ff83ec4ddaafd9d", + "changelog": "* Double size font for recovery words during the device setup\n* Optimizations for simultaneous access when more applications try communicate with the device", + "notes": "https://blog.trezor.io/trezor-firmware-1-3-5-allows-for-multisession-operation-cc4c25197855" + }, + { + "required": false, + "version": [1, 3, 4], + "min_bridge_version": [1, 1, 2], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.3.4.bin", + "fingerprint": "49e044eec84a9c210a09319d27a3ab8ba889ddeaa4d68f99d163f65267fce134", + "changelog": "* Screensaver active on ClearSession message\n* Support for NIST P-256 curve\n* Updated SignIdentity to v2 format\n* Show seconds counter during PIN lockdown\n* Updated maxfee per kb for coins", + "notes": "https://blog.trezor.io/trezor-firmware-1-3-4-enables-ssh-login-86a622d7e609" + }, + { + "required": true, + "version": [1, 3, 3], + "min_bridge_version": [1, 1, 0], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.3.3.bin", + "fingerprint": "7fcee4c0459c22109f3fcfe0040148e9be6d30947f7fffb76c66cc500681257c", + "changelog": "* Ask for PIN on GetAddress and GetPublicKey\n* Signing speed improved", + "notes": "http://satoshilabs.com/old/news/2015-04-07-trezor-firmware-1-3-3-connect-api/" + }, + { + "required": false, + "version": [1, 3, 2], + "min_bridge_version": [1, 1, 0], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.3.2.bin", + "fingerprint": "180656fbf94e43e0092eaf22c30ab3451a547b4213119bd62763dc97b94ad0d0", + "changelog": "* Fix check during transaction streaming\n* Login feature via SignIdentity message\n* GetAddress for multisig shows M of N description\n* PIN checking in constant time", + "notes": "" + }, + { + "required": false, + "version": [1, 3, 1], + "min_bridge_version": [1, 1, 0], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.3.1.bin", + "fingerprint": "8030e257fc4c75a8f4a0325f8ea37428dd8fc68a5f9ec5f8e2d1a0de328860cc", + "changelog": "* Optimized signing speed\n* Enabled OP_RETURN\n* Added option to change home screen\n* Moved fee calculation before any signing\n* Made PIN delay increase immune against hardware hacking", + "notes": "http://satoshilabs.com/old/news/2015-02-18-trezor-firmware-1-3-1-smart-property-notary-service-customized-home-screen/" + }, + { + "required": false, + "version": [1, 3, 0], + "min_bridge_version": [1, 1, 0], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.3.0.bin", + "fingerprint": "1d417e1e99a4880f7e03b991cf318eebe7b6cb453d2f55b8112adc5fd1a8293c", + "changelog": "* Added multisig support\n* Added visual validation of receiving address\n* Added ECIES encryption capabilities", + "notes": "http://satoshilabs.com/old/news/2015-01-13-trezor-firmware-1-3-0-update-multisig/" + }, + { + "required": true, + "version": [1, 2, 1], + "min_bridge_version": [1, 1, 0], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.2.1.bin", + "fingerprint": "0f8685ee46632162b549eb22b99a1e4e013d6796ae536ea6acb877a491f564f6", + "changelog": "* Added stack overflow protection\n* Added compatibility with Trezor Bridge", + "notes": "http://satoshilabs.com/old/news/2014-08-01-trezor-firmware-1-2-1-released/" + }, + { + "required": false, + "version": [1, 2, 0], + "min_bridge_version": [1, 1, 0], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.2.0.bin", + "fingerprint": "0eec6fd320730acfa40963f0f470a47109378663907cc78b9c5797c19938c873", + "changelog": "* Fix false positives for fee warning\n* Better UI for signing/verifying messages\n* Smaller firmware size" + }, + { + "required": false, + "version": [1, 1, 0], + "min_bridge_version": [1, 1, 0], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.1.0.bin", + "fingerprint": "a1709ead62659851933830f494cf9aa40047d1f098955aa93bd483b92df88c8e", + "changelog": "* Minor UI fixes\n* Better handling of unexpected messages\n* Added AES support" + }, + { + "required": true, + "version": [1, 0, 0], + "min_bridge_version": [1, 1, 0], + "min_firmware_version": [1, 0, 0], + "min_bootloader_version": [1, 0, 0], + "url": "firmware/1/trezor-1.0.0.bin", + "fingerprint": "79371ee2ed2db8489aa4a5bce6907c24afc6de47e9658fef4cc12e2d902d9c51", + "changelog": "* Added support for streaming of transactions into the device\n* Removed all current limits on size of signed transaction" + } +] diff --git a/app/trezor-prebuild/build/data/firmware/1/trezor-1.12.1-bitcoinonly.bin b/app/trezor-prebuild/build/data/firmware/1/trezor-1.12.1-bitcoinonly.bin new file mode 100644 index 0000000000..0e2a8e7004 --- /dev/null +++ b/app/trezor-prebuild/build/data/firmware/1/trezor-1.12.1-bitcoinonly.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce576268ce81d4fa7aa6a80d1c8ee01c49fdab4efaf9e0c703d899a24e168eb4 +size 569868 diff --git a/app/trezor-prebuild/build/data/firmware/1/trezor-1.12.1.bin b/app/trezor-prebuild/build/data/firmware/1/trezor-1.12.1.bin new file mode 100644 index 0000000000..1bf1bfe102 --- /dev/null +++ b/app/trezor-prebuild/build/data/firmware/1/trezor-1.12.1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eab18bf870d6096a2dee477a2f032dc3084a1864b6767a8f2f313a12dff2d180 +size 763676 diff --git a/app/trezor-prebuild/build/data/firmware/1/trezor-inter-v1.bin b/app/trezor-prebuild/build/data/firmware/1/trezor-inter-v1.bin new file mode 100644 index 0000000000..e91378fd13 --- /dev/null +++ b/app/trezor-prebuild/build/data/firmware/1/trezor-inter-v1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e90c7c7d0759f96b9ecf2a8ffc7912e44e125162f982f38c4eeacde411eafb91 +size 46012 diff --git a/app/trezor-prebuild/build/data/firmware/1/trezor-inter-v2.bin b/app/trezor-prebuild/build/data/firmware/1/trezor-inter-v2.bin new file mode 100644 index 0000000000..2066e4245a --- /dev/null +++ b/app/trezor-prebuild/build/data/firmware/1/trezor-inter-v2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3cbe77788536214804f5af4d91aebf3073bdcba9865d77a53c9be832a622c30 +size 45756 diff --git a/app/trezor-prebuild/build/data/firmware/1/trezor-inter-v3.bin b/app/trezor-prebuild/build/data/firmware/1/trezor-inter-v3.bin new file mode 100644 index 0000000000..587d4770d2 --- /dev/null +++ b/app/trezor-prebuild/build/data/firmware/1/trezor-inter-v3.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cdb86ea7acca0e48a063b48ca22679ca9093ec7cda9fa561ffc322cba7c3149 +size 45756 diff --git a/app/trezor-prebuild/build/data/firmware/2/releases.json b/app/trezor-prebuild/build/data/firmware/2/releases.json new file mode 100644 index 0000000000..e58d33e286 --- /dev/null +++ b/app/trezor-prebuild/build/data/firmware/2/releases.json @@ -0,0 +1,343 @@ +[ + { + "required": false, + "version": [2, 6, 0], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "bootloader_version": [2, 1, 0], + "url": "firmware/2/trezor-2.6.0.bin", + "url_bitcoinonly": "firmware/2/trezor-2.6.0-bitcoinonly.bin", + "fingerprint": "050526db604b9acceef2a5a8561bc99ecbe337909283ebb927b556d8e9b13872", + "fingerprint_bitcoinonly": "54f084dab4be1e64dc2cb970a6de87969407e4d6c48d79acdcf5d374ec0f29d6", + "notes": "https://trezor.io/learn/a/trezor-device-firmware-update-april-2023", + "changelog": "* Show source account path in BTC signing. \n* Address confirmation screen added to EIP712 signing flow. \n* Ability to reboot the device into bootloader mode directly, without needing to unplug the device. \n* Support for Ledger Live legacy derivation path \"m/44'/coin_type'/0'/account\". \n* Redesigned UI. \n* Homescreen now supports full-screen images. \n* Force basic attestation in FIDO2 for google.com." + }, + { + "required": false, + "version": [2, 5, 3], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.5.3.bin", + "url_bitcoinonly": "firmware/2/trezor-2.5.3-bitcoinonly.bin", + "fingerprint": "4f57dca1abc1a60d82c4fef7c96e86d784fc7a1e5e3da724dd2ae4d14c6350bf", + "fingerprint_bitcoinonly": "c094c84ba958129885fa725ee6ddb781b580fd2c7851e83aef9054ba4a10526c", + "notes": "https://blog.trezor.io/trezor-suite-and-trezor-model-t-firmware-update-november-2022-a0b30bb0abf5", + "changelog": "* Add SLIP-0025 coinjoin accounts. \n* Show red error header when Trezor doesn't see USB data connection. \n* Add support for Zcash unified addresses. \n* Show fee rate when replacing transaction. \n* Optimize the signing of BTC transactions. \n* Support for Cardano CIP-36 governance registration format. \n* Extend decimals of fee rate to 2 digits. \n* Display only “sat” instead of “sat BTC”. \n* Fix sending XMR transaction to an integrated address. \n* Fix XMR primary address display." + }, + { + "required": false, + "version": [2, 5, 2], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.5.2.bin", + "url_bitcoinonly": "firmware/2/trezor-2.5.2-bitcoinonly.bin", + "fingerprint": "659b1b698546fa63f24200e148b6f9a7044df31d11a0a5ec7c044f2dd83f4a27", + "fingerprint_bitcoinonly": "76aa25f9602cfb03cd3e07a82ac09226344eb355355aec216295e43b675eedf7", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-august-2022-a4e3d76214c1", + "changelog": "* Add support for Monero HF15 features. \n* Show the fee rate on the signing confirmation screen. \n* Support for Cardano Babbage era transaction items \n* Add \"Show All\"/\"Show Simple\" choice to Cardano transaction signing \n* Show thousands separator when displaying large amounts. \n* Fix Decred transaction weight calculation." + }, + { + "required": false, + "version": [2, 5, 1], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.5.1.bin", + "url_bitcoinonly": "firmware/2/trezor-2.5.1-bitcoinonly.bin", + "fingerprint": "782d4934897018cac779eebb0d7c66e21da7789b9cd35e1f99f097bdfd9b7d33", + "fingerprint_bitcoinonly": "db5d7b211532f717a32fe0b1bd3e3df6ad5464079a896a7f7492ab6e9e030bb5", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-may-2022-b1af60742291", + "changelog": "* Support Electrum signatures in VerifyMessage.\n* Support Cardano Alonzo-era transactions (Plutus).\n* Bitcoin bech32 addresses QR codes have bigger pixels which are easier to scan.\n* EIP-1559 transaction correctly show final Hold to Confirm screen.\n* Trezor will refuse to sign UTXOs that do not match the provided derivation path (e.g., transactions belonging to a different wallet, or synthetic transaction inputs).\n* Zcash v5 transaction format." + }, + { + "required": false, + "version": [2, 4, 3], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.4.3.bin", + "url_bitcoinonly": "firmware/2/trezor-2.4.3-bitcoinonly.bin", + "fingerprint": "a07f69d8d2065006a79c6b5636bd046496dbcb3820b41f1d604d8a4605ca4056", + "fingerprint_bitcoinonly": "1744efccabd479526392b281b7e0fc7aa2b4ecb454007dff7ca8c1f8171fad90", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-december-2021-d1e74c3ea283", + "changelog": "* Support Taproot.\n* Show address confirmation in SignMessage.\n* Support for advanced Cardano transactions and different derivations for compatibility.\n* Ethereum support for EIP712 (signing typed data)." + }, + { + "required": false, + "version": [2, 4, 2], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.4.2.bin", + "url_bitcoinonly": "firmware/2/trezor-2.4.2-bitcoinonly.bin", + "fingerprint": "54ccf155510b5292bd17ed748409d0d135112e24e62eb74184639460beecb213", + "fingerprint_bitcoinonly": "60fee3c9775d8ccf71099f6f7d277463efd128414cfb9be45656b1a26eeb7301", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-september-2021-a490f2ea16c1", + "changelog": "* Support for Ethereum EIP1559 transactions.\n* Re-enabled Firo support.\n* Memory optimization of BTC signing and CBOR decoding.\n* Support for large Cardano transactions.\n* Remove Lisk." + }, + { + "required": false, + "version": [2, 4, 1], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.4.1.bin", + "url_bitcoinonly": "firmware/2/trezor-2.4.1-bitcoinonly.bin", + "fingerprint": "84bc47bb197b3ae7bfb096f03d4a528ccf6c9ef4dfee0aac4022971e4ec91d68", + "fingerprint_bitcoinonly": "fce4503fcadb68dc72144a562ec0a59e7c8d083e403e01bfc4c584161d79f596", + "notes": "https://blog.trezor.io/trezor-suite-launches-8958c1d37d33", + "changelog": "* Security and major perfomance improvements.\n* Cardano fixes.\n* Fix red screen on shutdown." + }, + { + "required": false, + "version": [2, 4, 0], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.4.0.bin", + "url_bitcoinonly": "firmware/2/trezor-2.4.0-bitcoinonly.bin", + "fingerprint": "d90265ee6d7d499c7d938b5322f71f27042da8a6fdaed54c224d31b65e868def", + "fingerprint_bitcoinonly": "89c91287ab7a9cd3ec246b6822a0d04b7d40401abef706cccafbb7b98bd6a3d7", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-june-2021-c70aba9f0e3f", + "changelog": "* Locking the device by holding finger on the homescreen.\n* Support PIN of unlimited length.\n* Allow decreasing the output value in RBF transactions.\n* Reduce memory fragmentation.\n* Update FIDO icons.\n* Improve wording when showing multisig XPUBs." + }, + { + "required": false, + "version": [2, 3, 6], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.3.6.bin", + "url_bitcoinonly": "firmware/2/trezor-2.3.6-bitcoinonly.bin", + "fingerprint": "0efa3ba6135caea7693d145d60441eeb46283fe0b8b1fd59a04af33a638ad237", + "fingerprint_bitcoinonly": "e2cab40bb4c6ae65417b80ad564b905796038a0f5e6d0f50cead257fdd3a9c2d", + "changelog": "* Add compatibility paths for Unchained Capital" + }, + { + "required": false, + "version": [2, 3, 5], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.3.5.bin", + "url_bitcoinonly": "firmware/2/trezor-2.3.5-bitcoinonly.bin", + "fingerprint": "c0a6cacfed5c7a691314919c22307c29fbe9522071a9a28669769c014762d386", + "fingerprint_bitcoinonly": "53e7ee5bfc75cfa6412d8de5461b1ea8d9b7e10970ce7cadae9cbb1e17bbb77d", + "notes": "https://blog.trezor.io/trezor-suite-and-firmware-updates-rbf-and-spending-now-live-c2f69c42d7f7", + "changelog": "* Replacement transaction signing for replace-by-fee and PayJoin.\n* Support for Output Descriptors export.\n* Paginated display for signing/verifying long messages.\n* Show Ypub/Zpub correctly for multisig GetAddress.\n* Show amounts in mBTC, uBTC and sat denominations." + }, + { + "required": false, + "version": [2, 3, 4], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.3.4.bin", + "url_bitcoinonly": "firmware/2/trezor-2.3.4-bitcoinonly.bin", + "fingerprint": "58b51a6587993965979a744f8fcd5c4761f11ce4bec6b059a5d56bd0987d6658", + "fingerprint_bitcoinonly": "085acbba98163284ef86dea637f9442b924e80fea245f5ebb60d5aab3be2b7b6", + "notes": "https://blog.trezor.io/firmware-update-for-trezor-model-t-version-2-3-4-for-monero-hard-fork-c2ff972101d3", + "changelog": "* This firmware only contains the changes needed after the latest Monero update (HF13) by introducing support for the CLSAG transactions." + }, + { + "required": false, + "version": [2, 3, 3], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.3.3.bin", + "url_bitcoinonly": "firmware/2/trezor-2.3.3-bitcoinonly.bin", + "fingerprint": "46326222f8afcb82e1cd07867bc3bf8836f4e9d0f367e23b58d1e9bc32cd032e", + "fingerprint_bitcoinonly": "dda77cd7893a5f413f8fc4b2f44d1d43ed4b26e8ced5e6e578cc6b302c1a2310", + "notes": "https://blog.trezor.io/firmware-updates-for-trezor-model-t-version-2-3-3-and-trezor-model-one-version-1-9-3-c94f7a3b6fea", + "changelog": "* Advances the Passphrase feature by showing the entered passphrase on the Trezor screen before opening the wallet.\n* Adds support for Verge (XVG).\n* Drops support for Metaverse (ETP), GINcoin (GIN), Pesetacoin (PTC), and Zel (ZEL).\n* Introduces a hard limit on transaction fees to prevent accidentally paying extra hefty fees (the limit can be manually disabled).\n* Resolves the problems with generating the Crown addresses.\n* Re-enables spending altcoins from Bitcoin paths (fixing some compatibility issues with Bitcoin Cash wallets).\n* Fixes smaller issues with the user interface, customization, and more." + }, + { + "required": false, + "version": [2, 3, 2], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.3.2.bin", + "url_bitcoinonly": "firmware/2/trezor-2.3.2-bitcoinonly.bin", + "fingerprint": "f5ccdca0cbe163ecb93df726da72b69abb93f70d24d295db00b3ca2738216160", + "fingerprint_bitcoinonly": "389cb54fb6fc75489b788ad669ce51f41d47a67af54b8745a0dfe48da38a777f", + "notes": "https://blog.trezor.io/firmware-updates-for-trezor-model-t-version-2-3-2-and-trezor-model-one-version-1-9-2-f4f9c0f1ed7c", + "changelog": "* Introduces 'Autolock' feature, which automatically locks the device to enforce the PIN entry after a certain period.\n* Updates the Cardano support to enable staking and other Shelley updates.\n* Reintroduces the ability to spend pre-Overwinter (2018) funds on Zcash-like coins.\n* Fixes compatibility issues with Casa and GreenAddress.\n* Adds support for multiple change outputs in outgoing transactions.\n* Improves some interface elements." + }, + { + "required": false, + "version": [2, 3, 1], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.3.1.bin", + "url_bitcoinonly": "firmware/2/trezor-2.3.1-bitcoinonly.bin", + "fingerprint": "37178a5ec24e34f8a0599aebcadaf206af3ebadef2fc596665d617dd3e05a5db", + "fingerprint_bitcoinonly": "41795ec196f74c5d6acecc09047a5eacf1dfca47b0aeaa8442a69568efe20ddb", + "notes": "https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd", + "changelog": "* Refactor Bitcoin signing" + }, + { + "required": false, + "version": [2, 3, 0], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.3.0.bin", + "url_bitcoinonly": "firmware/2/trezor-2.3.0-bitcoinonly.bin", + "fingerprint": "212929f63fe1393e2ff57e06537a38cff281e3cfb3a4e17235079e2f08871e6c", + "fingerprint_bitcoinonly": "bddc0fd3b52fd32d94b776048f62b3d03dcb6ab90140e482a042a2863093115f", + "notes": "https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-0-and-trezor-model-t-version-2-3-0-46deb141fc09", + "changelog": "* Introduce Wipe code\n* Introduce SD card protection\n* Introduce passphrase cache\n* U2F UX improvements\n* Security fixes" + }, + { + "required": false, + "version": [2, 1, 8], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.1.8.bin", + "url_bitcoinonly": "firmware/2/trezor-2.1.8-bitcoinonly.bin", + "fingerprint": "8a5fa12132651b6e33344fd025d0d90885f5cc1c342427ebcea4f0ae98b50d8c", + "fingerprint_bitcoinonly": "ec752e9fa99a29979497e093b32bdb2b592783e2b48c87d8f6f0c18c73cd3022", + "changelog": "* Support Tezos 005-BABYLON hardfork\n* Show XPUBs in GetAddress for multisig\n* Security improvements" + }, + { + "required": false, + "version": [2, 1, 7], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.1.7.bin", + "url_bitcoinonly": "firmware/2/trezor-2.1.7-bitcoinonly.bin", + "fingerprint": "acf1b4c6fec3624a8fc53f9130ff53d690c3fa1c134bd4ca3e58ee7b5a0441d8", + "fingerprint_bitcoinonly": "fd92ac173a2cf93cc07ced3287e07800ed10466dc38c0c7240d9b20c689dd1d1", + "changelog": "* Super Shamir (with Groups)\n* FIDO2 support with credential management\n* Fix low memory issue" + }, + { + "required": false, + "version": [2, 1, 6], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 8], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.1.6.bin", + "url_bitcoinonly": "firmware/2/trezor-2.1.6-bitcoinonly.bin", + "fingerprint": "e2032ad84108a85d4014d477b955b9181a1a56e6f222ef21bb7d47b503a02f0b", + "fingerprint_bitcoinonly": "4e7f0f95d71631159b9e873f36a812c93a10eca1fad5f38c78ae7fbe4c1f6ed4", + "changelog": "* Super Shamir (with Groups)\n* FIDO2 support with credential management" + }, + { + "required": false, + "version": [2, 1, 5], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 1, 0], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.1.5.bin", + "url_bitcoinonly": "firmware/2/trezor-2.1.5-bitcoinonly.bin", + "fingerprint": "40e4bfaf3c5ec77872c1aaaac085aafcc443f60279ca2bb38d29c669233fdf62", + "fingerprint_bitcoinonly": "9de90d9f8ca12506f3b9a4cbe7616294144d965d67daa3a03bfe6c0b74a44843", + "changelog": "* Fix for sluggish U2F authentication when using Shamir\n* Fix UI for Shamir with 33 words\n* Fix Wanchain signing" + }, + { + "required": false, + "version": [2, 1, 4], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 1, 0], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.1.4.bin", + "fingerprint": "820611a92605b1ccc612b9bf8550617aec6962bd2484fcb6ae4792bc498654e4", + "changelog": "* Shamir Backup with Recovery persistence\n* Touchscreen freeze fix\n* Fix display of non-divisible OMNI amounts" + }, + { + "required": false, + "version": [2, 1, 1], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 5], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.1.1.bin", + "fingerprint": "1b3166a878658fcd2ff82c7ac9a2587da544fd105f678cc7b4d41cba5a8d4c01", + "changelog": "* Hotfix for touchscreen freeze\n* Don't rotate the screen via swipe gesture\n* Set screen rotation via user setting\n* More strict path validations\n* Display non-zero locktime values\n* EOS support\n* Monero UI fixes\n* Speed and memory optimizations" + }, + { + "required": false, + "version": [2, 1, 0], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 5], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.1.0.bin", + "tags": ["security"], + "fingerprint": "bb5b0308807b45d41d1e2ab66a468152997ad69a01099789d8a35e464cde999f", + "notes": "https://blog.trezor.io/firmware-updates-for-trezor-one-firmware-1-8-0-and-trezor-model-t-firmware-2-1-0-b9df91e048df", + "changelog": "* Security improvements\n* Upgraded to new storage format\n* Ripple, Stellar, Cardano and NEM fixes\n* New coins: ATS, AXE, FLO, GIN, KMD, NIX,\n PIVX, REOSC, XPM, XSN, ZCL\n* New ETH tokens" + }, + { + "required": false, + "version": [2, 0, 10], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 5], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.0.10.bin", + "fingerprint": "fcaa6ee206c2c121eb2d45d065d66f0879f14be45c244d4acf908be1de22275e", + "changelog": "* Fix Monero payment ID computation\n* Fix issue with touch screen and flickering\n* Add support for OMNI layer: OMNI/MAID/USDT\n* Add support for new coins: BTX, CPC, GAME, RVN\n* Add support for new Ethereum tokens" + }, + { + "required": false, + "version": [2, 0, 9], + "bootloader_version": [2, 0, 0], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 5], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.0.9.bin", + "fingerprint": "87be93d6966e7a9eff78dc7b434d1a138ec8d1ee0300882d16f90b606f3a806b", + "changelog": "* Small Monero and Segwit bugfixes" + }, + { + "required": false, + "version": [2, 0, 8], + "bootloader_version": [2, 0, 0], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 5], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.0.8.bin", + "fingerprint": "642b6215bda981f8eacafee34dbee5cdeee7d47d49f605bbe2828a8d9b79813d", + "changelog": "* Monero support\n* Cardano support\n* Stellar support\n* Ripple support\n* Tezos support\n* Decred support\n* Groestlcoin support\n* Zencash support\n* Zcash sapling hardfork support\n* Implemented seedless setup" + }, + { + "required": false, + "version": [2, 0, 7], + "bootloader_version": [2, 0, 0], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 5], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.0.7.bin", + "fingerprint": "f3a42e640e526fba6574fafa520fc7d97ef9f557d24da24d9a2ea4176a4c4164", + "changelog": "* Bitcoin Cash cashaddr support\n* Zcash Overwinter hardfork support\n* NEM support\n* Lisk support\n* Show warning on home screen if PIN is not set\n* Support for new coins:\n - Bitcoin Private, Fujicoin, Vertcoin, Viacoin, Zcoin\n* Support for new Ethereum networks:\n - EOS Classic, Ethereum Social, Ellaism, Callisto, EtherGem, Wanchain\n* Support for 500+ new Ethereum tokens", + "notes": "https://blog.trezor.io/june-updates-trezor-devices-one-modelt-wallet-zcash-cashaddr-doge-8d98c2a73036" + }, + { + "required": false, + "version": [2, 0, 6], + "bootloader_version": [2, 0, 0], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 5], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.0.6.bin", + "fingerprint": "4eccabf2fd7e121ed0da657c064a65c5694402497e60ea2ac2dcf1e118db9cc6", + "changelog": "* Fix layout for Ethereum transactions\n* Fix public key generation for SSH and GPG\n* Add special characters to passphrase keyboard" + }, + { + "required": true, + "version": [2, 0, 5], + "bootloader_version": [2, 0, 0], + "min_bridge_version": [2, 0, 7], + "min_firmware_version": [2, 0, 5], + "min_bootloader_version": [2, 0, 0], + "url": "firmware/2/trezor-2.0.5.bin", + "fingerprint": "851172eab96c07bf9efb43771cb0fd14dc0320a68de047132c7bd787a1ad64e9", + "changelog": "* First public release" + } +] diff --git a/app/trezor-prebuild/build/data/firmware/2/trezor-2.1.1.bin b/app/trezor-prebuild/build/data/firmware/2/trezor-2.1.1.bin new file mode 100644 index 0000000000..d13a28de61 --- /dev/null +++ b/app/trezor-prebuild/build/data/firmware/2/trezor-2.1.1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eab96238216e34052ba9d67fa26cec35401bb21ddca869315e8290204a29d75f +size 1471488 diff --git a/app/trezor-prebuild/build/data/firmware/2/trezor-2.6.0-bitcoinonly.bin b/app/trezor-prebuild/build/data/firmware/2/trezor-2.6.0-bitcoinonly.bin new file mode 100644 index 0000000000..98d366544d --- /dev/null +++ b/app/trezor-prebuild/build/data/firmware/2/trezor-2.6.0-bitcoinonly.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6fe574b2348beb45abb62d38bbf09b032a5082900667b6892218903aadf856f +size 1275904 diff --git a/app/trezor-prebuild/build/data/firmware/2/trezor-2.6.0.bin b/app/trezor-prebuild/build/data/firmware/2/trezor-2.6.0.bin new file mode 100644 index 0000000000..7e0fc664fc --- /dev/null +++ b/app/trezor-prebuild/build/data/firmware/2/trezor-2.6.0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5560b40a9fc470fc9f9552baed65241cb0496c5896c6336e2422b50ddf7cada +size 1577472 diff --git a/app/trezor-prebuild/build/data/messages/messages.json b/app/trezor-prebuild/build/data/messages/messages.json new file mode 100644 index 0000000000..ad9748b425 --- /dev/null +++ b/app/trezor-prebuild/build/data/messages/messages.json @@ -0,0 +1,9203 @@ +{ + "nested": { + "BinanceGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "BinanceAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "BinanceGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "BinancePublicKey": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BinanceSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "msg_count": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "account_number": { + "rule": "required", + "type": "sint64", + "id": 3 + }, + "chain_id": { + "type": "string", + "id": 4 + }, + "memo": { + "type": "string", + "id": 5 + }, + "sequence": { + "rule": "required", + "type": "sint64", + "id": 6 + }, + "source": { + "rule": "required", + "type": "sint64", + "id": 7 + } + } + }, + "BinanceTxRequest": { + "fields": {} + }, + "BinanceTransferMsg": { + "fields": { + "inputs": { + "rule": "repeated", + "type": "BinanceInputOutput", + "id": 1 + }, + "outputs": { + "rule": "repeated", + "type": "BinanceInputOutput", + "id": 2 + } + }, + "nested": { + "BinanceInputOutput": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "coins": { + "rule": "repeated", + "type": "BinanceCoin", + "id": 2 + } + } + }, + "BinanceCoin": { + "fields": { + "amount": { + "rule": "required", + "type": "sint64", + "id": 1 + }, + "denom": { + "rule": "required", + "type": "string", + "id": 2 + } + } + } + } + }, + "BinanceOrderMsg": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "ordertype": { + "rule": "required", + "type": "BinanceOrderType", + "id": 2 + }, + "price": { + "rule": "required", + "type": "sint64", + "id": 3 + }, + "quantity": { + "rule": "required", + "type": "sint64", + "id": 4 + }, + "sender": { + "type": "string", + "id": 5 + }, + "side": { + "rule": "required", + "type": "BinanceOrderSide", + "id": 6 + }, + "symbol": { + "type": "string", + "id": 7 + }, + "timeinforce": { + "rule": "required", + "type": "BinanceTimeInForce", + "id": 8 + } + }, + "nested": { + "BinanceOrderType": { + "values": { + "OT_UNKNOWN": 0, + "MARKET": 1, + "LIMIT": 2, + "OT_RESERVED": 3 + } + }, + "BinanceOrderSide": { + "values": { + "SIDE_UNKNOWN": 0, + "BUY": 1, + "SELL": 2 + } + }, + "BinanceTimeInForce": { + "values": { + "TIF_UNKNOWN": 0, + "GTE": 1, + "TIF_RESERVED": 2, + "IOC": 3 + } + } + } + }, + "BinanceCancelMsg": { + "fields": { + "refid": { + "type": "string", + "id": 1 + }, + "sender": { + "type": "string", + "id": 2 + }, + "symbol": { + "type": "string", + "id": 3 + } + } + }, + "BinanceSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "InputScriptType": { + "values": { + "SPENDADDRESS": 0, + "SPENDMULTISIG": 1, + "EXTERNAL": 2, + "SPENDWITNESS": 3, + "SPENDP2SHWITNESS": 4, + "SPENDTAPROOT": 5 + } + }, + "OutputScriptType": { + "values": { + "PAYTOADDRESS": 0, + "PAYTOSCRIPTHASH": 1, + "PAYTOMULTISIG": 2, + "PAYTOOPRETURN": 3, + "PAYTOWITNESS": 4, + "PAYTOP2SHWITNESS": 5, + "PAYTOTAPROOT": 6 + } + }, + "DecredStakingSpendType": { + "values": { + "SSGen": 0, + "SSRTX": 1 + } + }, + "AmountUnit": { + "values": { + "BITCOIN": 0, + "MILLIBITCOIN": 1, + "MICROBITCOIN": 2, + "SATOSHI": 3 + } + }, + "MultisigRedeemScriptType": { + "fields": { + "pubkeys": { + "rule": "repeated", + "type": "HDNodePathType", + "id": 1 + }, + "signatures": { + "rule": "repeated", + "type": "bytes", + "id": 2 + }, + "m": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "nodes": { + "rule": "repeated", + "type": "HDNodeType", + "id": 4 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 5, + "options": { + "packed": false + } + } + }, + "nested": { + "HDNodePathType": { + "fields": { + "node": { + "rule": "required", + "type": "HDNodeType", + "id": 1 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + } + } + } + } + }, + "GetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "ecdsa_curve_name": { + "type": "string", + "id": 2 + }, + "show_display": { + "type": "bool", + "id": 3 + }, + "coin_name": { + "type": "string", + "id": 4, + "options": { + "default": "Bitcoin" + } + }, + "script_type": { + "type": "InputScriptType", + "id": 5, + "options": { + "default": "SPENDADDRESS" + } + }, + "ignore_xpub_magic": { + "type": "bool", + "id": 6 + } + } + }, + "PublicKey": { + "fields": { + "node": { + "rule": "required", + "type": "HDNodeType", + "id": 1 + }, + "xpub": { + "rule": "required", + "type": "string", + "id": 2 + }, + "root_fingerprint": { + "type": "uint32", + "id": 3 + } + } + }, + "GetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "coin_name": { + "type": "string", + "id": 2, + "options": { + "default": "Bitcoin" + } + }, + "show_display": { + "type": "bool", + "id": 3 + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 4 + }, + "script_type": { + "type": "InputScriptType", + "id": 5, + "options": { + "default": "SPENDADDRESS" + } + }, + "ignore_xpub_magic": { + "type": "bool", + "id": 6 + } + } + }, + "Address": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "mac": { + "type": "bytes", + "id": 2 + } + } + }, + "GetOwnershipId": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "coin_name": { + "type": "string", + "id": 2, + "options": { + "default": "Bitcoin" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 3 + }, + "script_type": { + "type": "InputScriptType", + "id": 4, + "options": { + "default": "SPENDADDRESS" + } + } + } + }, + "OwnershipId": { + "fields": { + "ownership_id": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "SignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "coin_name": { + "type": "string", + "id": 3, + "options": { + "default": "Bitcoin" + } + }, + "script_type": { + "type": "InputScriptType", + "id": 4, + "options": { + "default": "SPENDADDRESS" + } + }, + "no_script_type": { + "type": "bool", + "id": 5 + } + } + }, + "MessageSignature": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "VerifyMessage": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "coin_name": { + "type": "string", + "id": 4, + "options": { + "default": "Bitcoin" + } + } + } + }, + "SignTx": { + "fields": { + "outputs_count": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "inputs_count": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "coin_name": { + "type": "string", + "id": 3, + "options": { + "default": "Bitcoin" + } + }, + "version": { + "type": "uint32", + "id": 4, + "options": { + "default": 1 + } + }, + "lock_time": { + "type": "uint32", + "id": 5, + "options": { + "default": 0 + } + }, + "expiry": { + "type": "uint32", + "id": 6 + }, + "overwintered": { + "type": "bool", + "id": 7, + "options": { + "deprecated": true + } + }, + "version_group_id": { + "type": "uint32", + "id": 8 + }, + "timestamp": { + "type": "uint32", + "id": 9 + }, + "branch_id": { + "type": "uint32", + "id": 10 + }, + "amount_unit": { + "type": "AmountUnit", + "id": 11, + "options": { + "default": "BITCOIN" + } + }, + "decred_staking_ticket": { + "type": "bool", + "id": 12, + "options": { + "default": false + } + }, + "serialize": { + "type": "bool", + "id": 13, + "options": { + "default": true + } + }, + "coinjoin_request": { + "type": "CoinJoinRequest", + "id": 14 + } + }, + "nested": { + "CoinJoinRequest": { + "fields": { + "fee_rate": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "no_fee_threshold": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "min_registrable_amount": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "mask_public_key": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 5 + } + } + } + } + }, + "TxRequest": { + "fields": { + "request_type": { + "type": "RequestType", + "id": 1 + }, + "details": { + "type": "TxRequestDetailsType", + "id": 2 + }, + "serialized": { + "type": "TxRequestSerializedType", + "id": 3 + } + }, + "nested": { + "RequestType": { + "values": { + "TXINPUT": 0, + "TXOUTPUT": 1, + "TXMETA": 2, + "TXFINISHED": 3, + "TXEXTRADATA": 4, + "TXORIGINPUT": 5, + "TXORIGOUTPUT": 6, + "TXPAYMENTREQ": 7 + } + }, + "TxRequestDetailsType": { + "fields": { + "request_index": { + "type": "uint32", + "id": 1 + }, + "tx_hash": { + "type": "bytes", + "id": 2 + }, + "extra_data_len": { + "type": "uint32", + "id": 3 + }, + "extra_data_offset": { + "type": "uint32", + "id": 4 + } + } + }, + "TxRequestSerializedType": { + "fields": { + "signature_index": { + "type": "uint32", + "id": 1 + }, + "signature": { + "type": "bytes", + "id": 2 + }, + "serialized_tx": { + "type": "bytes", + "id": 3 + } + } + } + } + }, + "TxAck": { + "options": { + "deprecated": true + }, + "fields": { + "tx": { + "type": "TransactionType", + "id": 1 + } + }, + "nested": { + "TransactionType": { + "fields": { + "version": { + "type": "uint32", + "id": 1 + }, + "inputs": { + "rule": "repeated", + "type": "TxInputType", + "id": 2 + }, + "bin_outputs": { + "rule": "repeated", + "type": "TxOutputBinType", + "id": 3 + }, + "lock_time": { + "type": "uint32", + "id": 4 + }, + "outputs": { + "rule": "repeated", + "type": "TxOutputType", + "id": 5 + }, + "inputs_cnt": { + "type": "uint32", + "id": 6 + }, + "outputs_cnt": { + "type": "uint32", + "id": 7 + }, + "extra_data": { + "type": "bytes", + "id": 8 + }, + "extra_data_len": { + "type": "uint32", + "id": 9 + }, + "expiry": { + "type": "uint32", + "id": 10 + }, + "overwintered": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "version_group_id": { + "type": "uint32", + "id": 12 + }, + "timestamp": { + "type": "uint32", + "id": 13 + }, + "branch_id": { + "type": "uint32", + "id": 14 + } + }, + "nested": { + "TxInputType": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "script_sig": { + "type": "bytes", + "id": 4 + }, + "sequence": { + "type": "uint32", + "id": 5, + "options": { + "default": 4294967295 + } + }, + "script_type": { + "type": "InputScriptType", + "id": 6, + "options": { + "default": "SPENDADDRESS" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 7 + }, + "amount": { + "type": "uint64", + "id": 8 + }, + "decred_tree": { + "type": "uint32", + "id": 9 + }, + "witness": { + "type": "bytes", + "id": 13 + }, + "ownership_proof": { + "type": "bytes", + "id": 14 + }, + "commitment_data": { + "type": "bytes", + "id": 15 + }, + "orig_hash": { + "type": "bytes", + "id": 16 + }, + "orig_index": { + "type": "uint32", + "id": 17 + }, + "decred_staking_spend": { + "type": "DecredStakingSpendType", + "id": 18 + }, + "script_pubkey": { + "type": "bytes", + "id": 19 + }, + "coinjoin_flags": { + "type": "uint32", + "id": 20, + "options": { + "default": 0 + } + } + } + }, + "TxOutputBinType": { + "fields": { + "amount": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "script_pubkey": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "decred_script_version": { + "type": "uint32", + "id": 3 + } + } + }, + "TxOutputType": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "script_type": { + "type": "OutputScriptType", + "id": 4, + "options": { + "default": "PAYTOADDRESS" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 5 + }, + "op_return_data": { + "type": "bytes", + "id": 6 + }, + "orig_hash": { + "type": "bytes", + "id": 10 + }, + "orig_index": { + "type": "uint32", + "id": 11 + }, + "payment_req_index": { + "type": "uint32", + "id": 12, + "options": { + "(experimental_field)": true + } + } + } + } + } + } + } + }, + "TxInput": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "script_sig": { + "type": "bytes", + "id": 4 + }, + "sequence": { + "type": "uint32", + "id": 5, + "options": { + "default": 4294967295 + } + }, + "script_type": { + "type": "InputScriptType", + "id": 6, + "options": { + "default": "SPENDADDRESS" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 7 + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 8 + }, + "decred_tree": { + "type": "uint32", + "id": 9 + }, + "witness": { + "type": "bytes", + "id": 13 + }, + "ownership_proof": { + "type": "bytes", + "id": 14 + }, + "commitment_data": { + "type": "bytes", + "id": 15 + }, + "orig_hash": { + "type": "bytes", + "id": 16 + }, + "orig_index": { + "type": "uint32", + "id": 17 + }, + "decred_staking_spend": { + "type": "DecredStakingSpendType", + "id": 18 + }, + "script_pubkey": { + "type": "bytes", + "id": 19 + }, + "coinjoin_flags": { + "type": "uint32", + "id": 20, + "options": { + "default": 0 + } + } + } + }, + "TxOutput": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "script_type": { + "type": "OutputScriptType", + "id": 4, + "options": { + "default": "PAYTOADDRESS" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 5 + }, + "op_return_data": { + "type": "bytes", + "id": 6 + }, + "orig_hash": { + "type": "bytes", + "id": 10 + }, + "orig_index": { + "type": "uint32", + "id": 11 + }, + "payment_req_index": { + "type": "uint32", + "id": 12, + "options": { + "(experimental_field)": true + } + } + } + }, + "PrevTx": { + "fields": { + "version": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "lock_time": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "inputs_count": { + "rule": "required", + "type": "uint32", + "id": 6 + }, + "outputs_count": { + "rule": "required", + "type": "uint32", + "id": 7 + }, + "extra_data_len": { + "type": "uint32", + "id": 9, + "options": { + "default": 0 + } + }, + "expiry": { + "type": "uint32", + "id": 10 + }, + "version_group_id": { + "type": "uint32", + "id": 12 + }, + "timestamp": { + "type": "uint32", + "id": 13 + }, + "branch_id": { + "type": "uint32", + "id": 14 + } + } + }, + "PrevInput": { + "fields": { + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "script_sig": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "sequence": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "decred_tree": { + "type": "uint32", + "id": 9 + } + } + }, + "PrevOutput": { + "fields": { + "amount": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "script_pubkey": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "decred_script_version": { + "type": "uint32", + "id": 3 + } + } + }, + "TxAckPaymentRequest": { + "options": { + "(experimental_message)": true + }, + "fields": { + "nonce": { + "type": "bytes", + "id": 1 + }, + "recipient_name": { + "rule": "required", + "type": "string", + "id": 2 + }, + "memos": { + "rule": "repeated", + "type": "PaymentRequestMemo", + "id": 3 + }, + "amount": { + "type": "uint64", + "id": 4 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 5 + } + }, + "nested": { + "PaymentRequestMemo": { + "fields": { + "text_memo": { + "type": "TextMemo", + "id": 1 + }, + "refund_memo": { + "type": "RefundMemo", + "id": 2 + }, + "coin_purchase_memo": { + "type": "CoinPurchaseMemo", + "id": 3 + } + } + }, + "TextMemo": { + "fields": { + "text": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "RefundMemo": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "mac": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "CoinPurchaseMemo": { + "fields": { + "coin_type": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "amount": { + "rule": "required", + "type": "string", + "id": 2 + }, + "address": { + "rule": "required", + "type": "string", + "id": 3 + }, + "mac": { + "rule": "required", + "type": "bytes", + "id": 4 + } + } + } + } + }, + "TxAckInput": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "TxAckInputWrapper", + "id": 1 + } + }, + "nested": { + "TxAckInputWrapper": { + "fields": { + "input": { + "rule": "required", + "type": "TxInput", + "id": 2 + } + } + } + } + }, + "TxAckOutput": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "TxAckOutputWrapper", + "id": 1 + } + }, + "nested": { + "TxAckOutputWrapper": { + "fields": { + "output": { + "rule": "required", + "type": "TxOutput", + "id": 5 + } + } + } + } + }, + "TxAckPrevMeta": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "PrevTx", + "id": 1 + } + } + }, + "TxAckPrevInput": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "TxAckPrevInputWrapper", + "id": 1 + } + }, + "nested": { + "TxAckPrevInputWrapper": { + "fields": { + "input": { + "rule": "required", + "type": "PrevInput", + "id": 2 + } + } + } + } + }, + "TxAckPrevOutput": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "TxAckPrevOutputWrapper", + "id": 1 + } + }, + "nested": { + "TxAckPrevOutputWrapper": { + "fields": { + "output": { + "rule": "required", + "type": "PrevOutput", + "id": 3 + } + } + } + } + }, + "TxAckPrevExtraData": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "TxAckPrevExtraDataWrapper", + "id": 1 + } + }, + "nested": { + "TxAckPrevExtraDataWrapper": { + "fields": { + "extra_data_chunk": { + "rule": "required", + "type": "bytes", + "id": 8 + } + } + } + } + }, + "GetOwnershipProof": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "coin_name": { + "type": "string", + "id": 2, + "options": { + "default": "Bitcoin" + } + }, + "script_type": { + "type": "InputScriptType", + "id": 3, + "options": { + "default": "SPENDWITNESS" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 4 + }, + "user_confirmation": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "ownership_ids": { + "rule": "repeated", + "type": "bytes", + "id": 6 + }, + "commitment_data": { + "type": "bytes", + "id": 7, + "options": { + "default": "" + } + } + } + }, + "OwnershipProof": { + "fields": { + "ownership_proof": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "AuthorizeCoinJoin": { + "fields": { + "coordinator": { + "rule": "required", + "type": "string", + "id": 1 + }, + "max_rounds": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "max_coordinator_fee_rate": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "max_fee_per_kvbyte": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 5, + "options": { + "packed": false + } + }, + "coin_name": { + "type": "string", + "id": 6, + "options": { + "default": "Bitcoin" + } + }, + "script_type": { + "type": "InputScriptType", + "id": 7, + "options": { + "default": "SPENDADDRESS" + } + }, + "amount_unit": { + "type": "AmountUnit", + "id": 8, + "options": { + "default": "BITCOIN" + } + } + } + }, + "FirmwareErase": { + "fields": { + "length": { + "type": "uint32", + "id": 1 + } + } + }, + "FirmwareRequest": { + "fields": { + "offset": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "length": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "FirmwareUpload": { + "fields": { + "payload": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "hash": { + "type": "bytes", + "id": 2 + } + } + }, + "SelfTest": { + "fields": { + "payload": { + "type": "bytes", + "id": 1 + } + } + }, + "CardanoDerivationType": { + "values": { + "LEDGER": 0, + "ICARUS": 1, + "ICARUS_TREZOR": 2 + } + }, + "CardanoAddressType": { + "values": { + "BASE": 0, + "BASE_SCRIPT_KEY": 1, + "BASE_KEY_SCRIPT": 2, + "BASE_SCRIPT_SCRIPT": 3, + "POINTER": 4, + "POINTER_SCRIPT": 5, + "ENTERPRISE": 6, + "ENTERPRISE_SCRIPT": 7, + "BYRON": 8, + "REWARD": 14, + "REWARD_SCRIPT": 15 + } + }, + "CardanoNativeScriptType": { + "values": { + "PUB_KEY": 0, + "ALL": 1, + "ANY": 2, + "N_OF_K": 3, + "INVALID_BEFORE": 4, + "INVALID_HEREAFTER": 5 + } + }, + "CardanoNativeScriptHashDisplayFormat": { + "values": { + "HIDE": 0, + "BECH32": 1, + "POLICY_ID": 2 + } + }, + "CardanoTxOutputSerializationFormat": { + "values": { + "ARRAY_LEGACY": 0, + "MAP_BABBAGE": 1 + } + }, + "CardanoCertificateType": { + "values": { + "STAKE_REGISTRATION": 0, + "STAKE_DEREGISTRATION": 1, + "STAKE_DELEGATION": 2, + "STAKE_POOL_REGISTRATION": 3 + } + }, + "CardanoPoolRelayType": { + "values": { + "SINGLE_HOST_IP": 0, + "SINGLE_HOST_NAME": 1, + "MULTIPLE_HOST_NAME": 2 + } + }, + "CardanoTxAuxiliaryDataSupplementType": { + "values": { + "NONE": 0, + "CVOTE_REGISTRATION_SIGNATURE": 1 + } + }, + "CardanoCVoteRegistrationFormat": { + "values": { + "CIP15": 0, + "CIP36": 1 + } + }, + "CardanoTxSigningMode": { + "values": { + "ORDINARY_TRANSACTION": 0, + "POOL_REGISTRATION_AS_OWNER": 1, + "MULTISIG_TRANSACTION": 2, + "PLUTUS_TRANSACTION": 3 + } + }, + "CardanoTxWitnessType": { + "values": { + "BYRON_WITNESS": 0, + "SHELLEY_WITNESS": 1 + } + }, + "CardanoBlockchainPointerType": { + "fields": { + "block_index": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "tx_index": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "certificate_index": { + "rule": "required", + "type": "uint32", + "id": 3 + } + } + }, + "CardanoNativeScript": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoNativeScriptType", + "id": 1 + }, + "scripts": { + "rule": "repeated", + "type": "CardanoNativeScript", + "id": 2 + }, + "key_hash": { + "type": "bytes", + "id": 3 + }, + "key_path": { + "rule": "repeated", + "type": "uint32", + "id": 4, + "options": { + "packed": false + } + }, + "required_signatures_count": { + "type": "uint32", + "id": 5 + }, + "invalid_before": { + "type": "uint64", + "id": 6 + }, + "invalid_hereafter": { + "type": "uint64", + "id": 7 + } + } + }, + "CardanoGetNativeScriptHash": { + "fields": { + "script": { + "rule": "required", + "type": "CardanoNativeScript", + "id": 1 + }, + "display_format": { + "rule": "required", + "type": "CardanoNativeScriptHashDisplayFormat", + "id": 2 + }, + "derivation_type": { + "rule": "required", + "type": "CardanoDerivationType", + "id": 3 + } + } + }, + "CardanoNativeScriptHash": { + "fields": { + "script_hash": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "CardanoAddressParametersType": { + "fields": { + "address_type": { + "rule": "required", + "type": "CardanoAddressType", + "id": 1 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "address_n_staking": { + "rule": "repeated", + "type": "uint32", + "id": 3, + "options": { + "packed": false + } + }, + "staking_key_hash": { + "type": "bytes", + "id": 4 + }, + "certificate_pointer": { + "type": "CardanoBlockchainPointerType", + "id": 5 + }, + "script_payment_hash": { + "type": "bytes", + "id": 6 + }, + "script_staking_hash": { + "type": "bytes", + "id": 7 + } + } + }, + "CardanoGetAddress": { + "fields": { + "show_display": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "protocol_magic": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "network_id": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "address_parameters": { + "rule": "required", + "type": "CardanoAddressParametersType", + "id": 5 + }, + "derivation_type": { + "rule": "required", + "type": "CardanoDerivationType", + "id": 6 + } + } + }, + "CardanoAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "CardanoGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "derivation_type": { + "rule": "required", + "type": "CardanoDerivationType", + "id": 3 + } + } + }, + "CardanoPublicKey": { + "fields": { + "xpub": { + "rule": "required", + "type": "string", + "id": 1 + }, + "node": { + "rule": "required", + "type": "HDNodeType", + "id": 2 + } + } + }, + "CardanoSignTxInit": { + "fields": { + "signing_mode": { + "rule": "required", + "type": "CardanoTxSigningMode", + "id": 1 + }, + "protocol_magic": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "network_id": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "inputs_count": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "outputs_count": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 6 + }, + "ttl": { + "type": "uint64", + "id": 7 + }, + "certificates_count": { + "rule": "required", + "type": "uint32", + "id": 8 + }, + "withdrawals_count": { + "rule": "required", + "type": "uint32", + "id": 9 + }, + "has_auxiliary_data": { + "rule": "required", + "type": "bool", + "id": 10 + }, + "validity_interval_start": { + "type": "uint64", + "id": 11 + }, + "witness_requests_count": { + "rule": "required", + "type": "uint32", + "id": 12 + }, + "minting_asset_groups_count": { + "rule": "required", + "type": "uint32", + "id": 13 + }, + "derivation_type": { + "rule": "required", + "type": "CardanoDerivationType", + "id": 14 + }, + "include_network_id": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "script_data_hash": { + "type": "bytes", + "id": 16 + }, + "collateral_inputs_count": { + "rule": "required", + "type": "uint32", + "id": 17 + }, + "required_signers_count": { + "rule": "required", + "type": "uint32", + "id": 18 + }, + "has_collateral_return": { + "type": "bool", + "id": 19, + "options": { + "default": false + } + }, + "total_collateral": { + "type": "uint64", + "id": 20 + }, + "reference_inputs_count": { + "type": "uint32", + "id": 21, + "options": { + "default": 0 + } + } + } + }, + "CardanoTxInput": { + "fields": { + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "CardanoTxOutput": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "address_parameters": { + "type": "CardanoAddressParametersType", + "id": 2 + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "asset_groups_count": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "datum_hash": { + "type": "bytes", + "id": 5 + }, + "format": { + "type": "CardanoTxOutputSerializationFormat", + "id": 6, + "options": { + "default": "ARRAY_LEGACY" + } + }, + "inline_datum_size": { + "type": "uint32", + "id": 7, + "options": { + "default": 0 + } + }, + "reference_script_size": { + "type": "uint32", + "id": 8, + "options": { + "default": 0 + } + } + } + }, + "CardanoAssetGroup": { + "fields": { + "policy_id": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "tokens_count": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "CardanoToken": { + "fields": { + "asset_name_bytes": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "amount": { + "type": "uint64", + "id": 2 + }, + "mint_amount": { + "type": "sint64", + "id": 3 + } + } + }, + "CardanoTxInlineDatumChunk": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "CardanoTxReferenceScriptChunk": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "CardanoPoolOwner": { + "fields": { + "staking_key_path": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "staking_key_hash": { + "type": "bytes", + "id": 2 + } + } + }, + "CardanoPoolRelayParameters": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoPoolRelayType", + "id": 1 + }, + "ipv4_address": { + "type": "bytes", + "id": 2 + }, + "ipv6_address": { + "type": "bytes", + "id": 3 + }, + "host_name": { + "type": "string", + "id": 4 + }, + "port": { + "type": "uint32", + "id": 5 + } + } + }, + "CardanoPoolMetadataType": { + "fields": { + "url": { + "rule": "required", + "type": "string", + "id": 1 + }, + "hash": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "CardanoPoolParametersType": { + "fields": { + "pool_id": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "vrf_key_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "pledge": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "cost": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "margin_numerator": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "margin_denominator": { + "rule": "required", + "type": "uint64", + "id": 6 + }, + "reward_account": { + "rule": "required", + "type": "string", + "id": 7 + }, + "metadata": { + "type": "CardanoPoolMetadataType", + "id": 10 + }, + "owners_count": { + "rule": "required", + "type": "uint32", + "id": 11 + }, + "relays_count": { + "rule": "required", + "type": "uint32", + "id": 12 + } + } + }, + "CardanoTxCertificate": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoCertificateType", + "id": 1 + }, + "path": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "pool": { + "type": "bytes", + "id": 3 + }, + "pool_parameters": { + "type": "CardanoPoolParametersType", + "id": 4 + }, + "script_hash": { + "type": "bytes", + "id": 5 + }, + "key_hash": { + "type": "bytes", + "id": 6 + } + } + }, + "CardanoTxWithdrawal": { + "fields": { + "path": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "script_hash": { + "type": "bytes", + "id": 3 + }, + "key_hash": { + "type": "bytes", + "id": 4 + } + } + }, + "CardanoCVoteRegistrationDelegation": { + "fields": { + "vote_public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "weight": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "CardanoCVoteRegistrationParametersType": { + "fields": { + "vote_public_key": { + "type": "bytes", + "id": 1 + }, + "staking_path": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "payment_address_parameters": { + "type": "CardanoAddressParametersType", + "id": 3 + }, + "nonce": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "format": { + "type": "CardanoCVoteRegistrationFormat", + "id": 5, + "options": { + "default": "CIP15" + } + }, + "delegations": { + "rule": "repeated", + "type": "CardanoCVoteRegistrationDelegation", + "id": 6 + }, + "voting_purpose": { + "type": "uint64", + "id": 7 + }, + "payment_address": { + "type": "string", + "id": 8 + } + } + }, + "CardanoTxAuxiliaryData": { + "fields": { + "cvote_registration_parameters": { + "type": "CardanoCVoteRegistrationParametersType", + "id": 1 + }, + "hash": { + "type": "bytes", + "id": 2 + } + } + }, + "CardanoTxMint": { + "fields": { + "asset_groups_count": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "CardanoTxCollateralInput": { + "fields": { + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "CardanoTxRequiredSigner": { + "fields": { + "key_hash": { + "type": "bytes", + "id": 1 + }, + "key_path": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + } + } + }, + "CardanoTxReferenceInput": { + "fields": { + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "CardanoTxItemAck": { + "fields": {} + }, + "CardanoTxAuxiliaryDataSupplement": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoTxAuxiliaryDataSupplementType", + "id": 1 + }, + "auxiliary_data_hash": { + "type": "bytes", + "id": 2 + }, + "cvote_registration_signature": { + "type": "bytes", + "id": 3 + } + } + }, + "CardanoTxWitnessRequest": { + "fields": { + "path": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + } + } + }, + "CardanoTxWitnessResponse": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoTxWitnessType", + "id": 1 + }, + "pub_key": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "chain_code": { + "type": "bytes", + "id": 4 + } + } + }, + "CardanoTxHostAck": { + "fields": {} + }, + "CardanoTxBodyHash": { + "fields": { + "tx_hash": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "CardanoSignTxFinished": { + "fields": {} + }, + "Success": { + "fields": { + "message": { + "type": "string", + "id": 1, + "options": { + "default": "" + } + } + } + }, + "Failure": { + "fields": { + "code": { + "type": "FailureType", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + } + }, + "nested": { + "FailureType": { + "values": { + "Failure_UnexpectedMessage": 1, + "Failure_ButtonExpected": 2, + "Failure_DataError": 3, + "Failure_ActionCancelled": 4, + "Failure_PinExpected": 5, + "Failure_PinCancelled": 6, + "Failure_PinInvalid": 7, + "Failure_InvalidSignature": 8, + "Failure_ProcessError": 9, + "Failure_NotEnoughFunds": 10, + "Failure_NotInitialized": 11, + "Failure_PinMismatch": 12, + "Failure_WipeCodeMismatch": 13, + "Failure_InvalidSession": 14, + "Failure_FirmwareError": 99 + } + } + } + }, + "ButtonRequest": { + "fields": { + "code": { + "type": "ButtonRequestType", + "id": 1 + }, + "pages": { + "type": "uint32", + "id": 2 + } + }, + "nested": { + "ButtonRequestType": { + "valuesOptions": { + "_Deprecated_ButtonRequest_PassphraseType": { + "deprecated": true + } + }, + "values": { + "ButtonRequest_Other": 1, + "ButtonRequest_FeeOverThreshold": 2, + "ButtonRequest_ConfirmOutput": 3, + "ButtonRequest_ResetDevice": 4, + "ButtonRequest_ConfirmWord": 5, + "ButtonRequest_WipeDevice": 6, + "ButtonRequest_ProtectCall": 7, + "ButtonRequest_SignTx": 8, + "ButtonRequest_FirmwareCheck": 9, + "ButtonRequest_Address": 10, + "ButtonRequest_PublicKey": 11, + "ButtonRequest_MnemonicWordCount": 12, + "ButtonRequest_MnemonicInput": 13, + "_Deprecated_ButtonRequest_PassphraseType": 14, + "ButtonRequest_UnknownDerivationPath": 15, + "ButtonRequest_RecoveryHomepage": 16, + "ButtonRequest_Success": 17, + "ButtonRequest_Warning": 18, + "ButtonRequest_PassphraseEntry": 19, + "ButtonRequest_PinEntry": 20 + } + } + } + }, + "ButtonAck": { + "fields": {} + }, + "PinMatrixRequest": { + "fields": { + "type": { + "type": "PinMatrixRequestType", + "id": 1 + } + }, + "nested": { + "PinMatrixRequestType": { + "values": { + "PinMatrixRequestType_Current": 1, + "PinMatrixRequestType_NewFirst": 2, + "PinMatrixRequestType_NewSecond": 3, + "PinMatrixRequestType_WipeCodeFirst": 4, + "PinMatrixRequestType_WipeCodeSecond": 5 + } + } + } + }, + "PinMatrixAck": { + "fields": { + "pin": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "PassphraseRequest": { + "fields": { + "_on_device": { + "type": "bool", + "id": 1, + "options": { + "deprecated": true + } + } + } + }, + "PassphraseAck": { + "fields": { + "passphrase": { + "type": "string", + "id": 1 + }, + "_state": { + "type": "bytes", + "id": 2, + "options": { + "deprecated": true + } + }, + "on_device": { + "type": "bool", + "id": 3 + } + } + }, + "Deprecated_PassphraseStateRequest": { + "options": { + "deprecated": true + }, + "fields": { + "state": { + "type": "bytes", + "id": 1 + } + } + }, + "Deprecated_PassphraseStateAck": { + "options": { + "deprecated": true + }, + "fields": {} + }, + "HDNodeType": { + "fields": { + "depth": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "fingerprint": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "child_num": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "chain_code": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "private_key": { + "type": "bytes", + "id": 5 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 6 + } + } + }, + "CipherKeyValue": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "key": { + "rule": "required", + "type": "string", + "id": 2 + }, + "value": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "encrypt": { + "type": "bool", + "id": 4 + }, + "ask_on_encrypt": { + "type": "bool", + "id": 5 + }, + "ask_on_decrypt": { + "type": "bool", + "id": 6 + }, + "iv": { + "type": "bytes", + "id": 7 + } + } + }, + "CipheredKeyValue": { + "fields": { + "value": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "IdentityType": { + "fields": { + "proto": { + "type": "string", + "id": 1 + }, + "user": { + "type": "string", + "id": 2 + }, + "host": { + "type": "string", + "id": 3 + }, + "port": { + "type": "string", + "id": 4 + }, + "path": { + "type": "string", + "id": 5 + }, + "index": { + "type": "uint32", + "id": 6, + "options": { + "default": 0 + } + } + } + }, + "SignIdentity": { + "fields": { + "identity": { + "rule": "required", + "type": "IdentityType", + "id": 1 + }, + "challenge_hidden": { + "type": "bytes", + "id": 2, + "options": { + "default": "" + } + }, + "challenge_visual": { + "type": "string", + "id": 3, + "options": { + "default": "" + } + }, + "ecdsa_curve_name": { + "type": "string", + "id": 4 + } + } + }, + "SignedIdentity": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 3 + } + } + }, + "GetECDHSessionKey": { + "fields": { + "identity": { + "rule": "required", + "type": "IdentityType", + "id": 1 + }, + "peer_public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "ecdsa_curve_name": { + "type": "string", + "id": 3 + } + } + }, + "ECDHSessionKey": { + "fields": { + "session_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + } + } + }, + "CosiCommit": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "data": { + "type": "bytes", + "id": 2, + "options": { + "deprecated": true + } + } + } + }, + "CosiCommitment": { + "fields": { + "commitment": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "pubkey": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "CosiSign": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "data": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "global_commitment": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "global_pubkey": { + "rule": "required", + "type": "bytes", + "id": 4 + } + } + }, + "CosiSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "DebugLinkDecision": { + "fields": { + "button": { + "type": "DebugButton", + "id": 1 + }, + "swipe": { + "type": "DebugSwipeDirection", + "id": 2 + }, + "input": { + "type": "string", + "id": 3 + }, + "x": { + "type": "uint32", + "id": 4 + }, + "y": { + "type": "uint32", + "id": 5 + }, + "wait": { + "type": "bool", + "id": 6 + }, + "hold_ms": { + "type": "uint32", + "id": 7 + }, + "physical_button": { + "type": "DebugPhysicalButton", + "id": 8 + } + }, + "nested": { + "DebugSwipeDirection": { + "values": { + "UP": 0, + "DOWN": 1, + "LEFT": 2, + "RIGHT": 3 + } + }, + "DebugButton": { + "values": { + "NO": 0, + "YES": 1, + "INFO": 2 + } + }, + "DebugPhysicalButton": { + "values": { + "LEFT_BTN": 0, + "MIDDLE_BTN": 1, + "RIGHT_BTN": 2 + } + } + } + }, + "DebugLinkLayout": { + "fields": { + "tokens": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "DebugLinkReseedRandom": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "DebugLinkRecordScreen": { + "fields": { + "target_directory": { + "type": "string", + "id": 1 + }, + "refresh_index": { + "type": "uint32", + "id": 2, + "options": { + "default": 0 + } + } + } + }, + "DebugLinkGetState": { + "fields": { + "wait_word_list": { + "type": "bool", + "id": 1 + }, + "wait_word_pos": { + "type": "bool", + "id": 2 + }, + "wait_layout": { + "type": "bool", + "id": 3 + } + } + }, + "DebugLinkState": { + "fields": { + "layout": { + "type": "bytes", + "id": 1 + }, + "pin": { + "type": "string", + "id": 2 + }, + "matrix": { + "type": "string", + "id": 3 + }, + "mnemonic_secret": { + "type": "bytes", + "id": 4 + }, + "node": { + "type": "HDNodeType", + "id": 5 + }, + "passphrase_protection": { + "type": "bool", + "id": 6 + }, + "reset_word": { + "type": "string", + "id": 7 + }, + "reset_entropy": { + "type": "bytes", + "id": 8 + }, + "recovery_fake_word": { + "type": "string", + "id": 9 + }, + "recovery_word_pos": { + "type": "uint32", + "id": 10 + }, + "reset_word_pos": { + "type": "uint32", + "id": 11 + }, + "mnemonic_type": { + "type": "BackupType", + "id": 12 + }, + "tokens": { + "rule": "repeated", + "type": "string", + "id": 13 + } + } + }, + "DebugLinkStop": { + "fields": {} + }, + "DebugLinkLog": { + "fields": { + "level": { + "type": "uint32", + "id": 1 + }, + "bucket": { + "type": "string", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + } + } + }, + "DebugLinkMemoryRead": { + "fields": { + "address": { + "type": "uint32", + "id": 1 + }, + "length": { + "type": "uint32", + "id": 2 + } + } + }, + "DebugLinkMemory": { + "fields": { + "memory": { + "type": "bytes", + "id": 1 + } + } + }, + "DebugLinkMemoryWrite": { + "fields": { + "address": { + "type": "uint32", + "id": 1 + }, + "memory": { + "type": "bytes", + "id": 2 + }, + "flash": { + "type": "bool", + "id": 3 + } + } + }, + "DebugLinkFlashErase": { + "fields": { + "sector": { + "type": "uint32", + "id": 1 + } + } + }, + "DebugLinkEraseSdCard": { + "fields": { + "format": { + "type": "bool", + "id": 1 + } + } + }, + "DebugLinkWatchLayout": { + "fields": { + "watch": { + "type": "bool", + "id": 1 + } + } + }, + "DebugLinkResetDebugEvents": { + "fields": {} + }, + "EosGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "EosPublicKey": { + "fields": { + "wif_public_key": { + "rule": "required", + "type": "string", + "id": 1 + }, + "raw_public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "EosSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "chain_id": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "header": { + "rule": "required", + "type": "EosTxHeader", + "id": 3 + }, + "num_actions": { + "rule": "required", + "type": "uint32", + "id": 4 + } + }, + "nested": { + "EosTxHeader": { + "fields": { + "expiration": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "ref_block_num": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "ref_block_prefix": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "max_net_usage_words": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "max_cpu_usage_ms": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "delay_sec": { + "rule": "required", + "type": "uint32", + "id": 6 + } + } + } + } + }, + "EosTxActionRequest": { + "fields": { + "data_size": { + "type": "uint32", + "id": 1 + } + } + }, + "EosTxActionAck": { + "fields": { + "common": { + "rule": "required", + "type": "EosActionCommon", + "id": 1 + }, + "transfer": { + "type": "EosActionTransfer", + "id": 2 + }, + "delegate": { + "type": "EosActionDelegate", + "id": 3 + }, + "undelegate": { + "type": "EosActionUndelegate", + "id": 4 + }, + "refund": { + "type": "EosActionRefund", + "id": 5 + }, + "buy_ram": { + "type": "EosActionBuyRam", + "id": 6 + }, + "buy_ram_bytes": { + "type": "EosActionBuyRamBytes", + "id": 7 + }, + "sell_ram": { + "type": "EosActionSellRam", + "id": 8 + }, + "vote_producer": { + "type": "EosActionVoteProducer", + "id": 9 + }, + "update_auth": { + "type": "EosActionUpdateAuth", + "id": 10 + }, + "delete_auth": { + "type": "EosActionDeleteAuth", + "id": 11 + }, + "link_auth": { + "type": "EosActionLinkAuth", + "id": 12 + }, + "unlink_auth": { + "type": "EosActionUnlinkAuth", + "id": 13 + }, + "new_account": { + "type": "EosActionNewAccount", + "id": 14 + }, + "unknown": { + "type": "EosActionUnknown", + "id": 15 + } + }, + "nested": { + "EosAsset": { + "fields": { + "amount": { + "rule": "required", + "type": "sint64", + "id": 1 + }, + "symbol": { + "rule": "required", + "type": "uint64", + "id": 2 + } + } + }, + "EosPermissionLevel": { + "fields": { + "actor": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "permission": { + "rule": "required", + "type": "uint64", + "id": 2 + } + } + }, + "EosAuthorizationKey": { + "fields": { + "type": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "key": { + "type": "bytes", + "id": 2 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 3, + "options": { + "packed": false + } + }, + "weight": { + "rule": "required", + "type": "uint32", + "id": 4 + } + } + }, + "EosAuthorizationAccount": { + "fields": { + "account": { + "rule": "required", + "type": "EosPermissionLevel", + "id": 1 + }, + "weight": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "EosAuthorizationWait": { + "fields": { + "wait_sec": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "weight": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "EosAuthorization": { + "fields": { + "threshold": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "keys": { + "rule": "repeated", + "type": "EosAuthorizationKey", + "id": 2 + }, + "accounts": { + "rule": "repeated", + "type": "EosAuthorizationAccount", + "id": 3 + }, + "waits": { + "rule": "repeated", + "type": "EosAuthorizationWait", + "id": 4 + } + } + }, + "EosActionCommon": { + "fields": { + "account": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "name": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "authorization": { + "rule": "repeated", + "type": "EosPermissionLevel", + "id": 3 + } + } + }, + "EosActionTransfer": { + "fields": { + "sender": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "receiver": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "quantity": { + "rule": "required", + "type": "EosAsset", + "id": 3 + }, + "memo": { + "rule": "required", + "type": "string", + "id": 4 + } + } + }, + "EosActionDelegate": { + "fields": { + "sender": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "receiver": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "net_quantity": { + "rule": "required", + "type": "EosAsset", + "id": 3 + }, + "cpu_quantity": { + "rule": "required", + "type": "EosAsset", + "id": 4 + }, + "transfer": { + "rule": "required", + "type": "bool", + "id": 5 + } + } + }, + "EosActionUndelegate": { + "fields": { + "sender": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "receiver": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "net_quantity": { + "rule": "required", + "type": "EosAsset", + "id": 3 + }, + "cpu_quantity": { + "rule": "required", + "type": "EosAsset", + "id": 4 + } + } + }, + "EosActionRefund": { + "fields": { + "owner": { + "rule": "required", + "type": "uint64", + "id": 1 + } + } + }, + "EosActionBuyRam": { + "fields": { + "payer": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "receiver": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "quantity": { + "rule": "required", + "type": "EosAsset", + "id": 3 + } + } + }, + "EosActionBuyRamBytes": { + "fields": { + "payer": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "receiver": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "bytes": { + "rule": "required", + "type": "uint32", + "id": 3 + } + } + }, + "EosActionSellRam": { + "fields": { + "account": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "bytes": { + "rule": "required", + "type": "uint64", + "id": 2 + } + } + }, + "EosActionVoteProducer": { + "fields": { + "voter": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "proxy": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "producers": { + "rule": "repeated", + "type": "uint64", + "id": 3, + "options": { + "packed": false + } + } + } + }, + "EosActionUpdateAuth": { + "fields": { + "account": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "permission": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "parent": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "auth": { + "rule": "required", + "type": "EosAuthorization", + "id": 4 + } + } + }, + "EosActionDeleteAuth": { + "fields": { + "account": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "permission": { + "rule": "required", + "type": "uint64", + "id": 2 + } + } + }, + "EosActionLinkAuth": { + "fields": { + "account": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "code": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "type": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "requirement": { + "rule": "required", + "type": "uint64", + "id": 4 + } + } + }, + "EosActionUnlinkAuth": { + "fields": { + "account": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "code": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "type": { + "rule": "required", + "type": "uint64", + "id": 3 + } + } + }, + "EosActionNewAccount": { + "fields": { + "creator": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "name": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "owner": { + "rule": "required", + "type": "EosAuthorization", + "id": 3 + }, + "active": { + "rule": "required", + "type": "EosAuthorization", + "id": 4 + } + } + }, + "EosActionUnknown": { + "fields": { + "data_size": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "data_chunk": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + } + } + }, + "EosSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "EthereumDefinitionType": { + "values": { + "NETWORK": 0, + "TOKEN": 1 + } + }, + "EthereumNetworkInfo": { + "fields": { + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "symbol": { + "rule": "required", + "type": "string", + "id": 2 + }, + "slip44": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "name": { + "rule": "required", + "type": "string", + "id": 4 + } + } + }, + "EthereumTokenInfo": { + "fields": { + "address": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "symbol": { + "rule": "required", + "type": "string", + "id": 3 + }, + "decimals": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "name": { + "rule": "required", + "type": "string", + "id": 5 + } + } + }, + "EthereumDefinitions": { + "fields": { + "encoded_network": { + "type": "bytes", + "id": 1 + }, + "encoded_token": { + "type": "bytes", + "id": 2 + } + } + }, + "EthereumSignTypedData": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "primary_type": { + "rule": "required", + "type": "string", + "id": 2 + }, + "metamask_v4_compat": { + "type": "bool", + "id": 3, + "options": { + "default": true + } + }, + "definitions": { + "type": "EthereumDefinitions", + "id": 4 + } + } + }, + "EthereumTypedDataStructRequest": { + "fields": { + "name": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "EthereumTypedDataStructAck": { + "fields": { + "members": { + "rule": "repeated", + "type": "EthereumStructMember", + "id": 1 + } + }, + "nested": { + "EthereumStructMember": { + "fields": { + "type": { + "rule": "required", + "type": "EthereumFieldType", + "id": 1 + }, + "name": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "EthereumFieldType": { + "fields": { + "data_type": { + "rule": "required", + "type": "EthereumDataType", + "id": 1 + }, + "size": { + "type": "uint32", + "id": 2 + }, + "entry_type": { + "type": "EthereumFieldType", + "id": 3 + }, + "struct_name": { + "type": "string", + "id": 4 + } + } + }, + "EthereumDataType": { + "values": { + "UINT": 1, + "INT": 2, + "BYTES": 3, + "STRING": 4, + "BOOL": 5, + "ADDRESS": 6, + "ARRAY": 7, + "STRUCT": 8 + } + } + } + }, + "EthereumTypedDataValueRequest": { + "fields": { + "member_path": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + } + } + }, + "EthereumTypedDataValueAck": { + "fields": { + "value": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "EthereumGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "EthereumPublicKey": { + "fields": { + "node": { + "rule": "required", + "type": "HDNodeType", + "id": 1 + }, + "xpub": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "EthereumGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "encoded_network": { + "type": "bytes", + "id": 3 + } + } + }, + "EthereumAddress": { + "fields": { + "_old_address": { + "type": "bytes", + "id": 1, + "options": { + "deprecated": true + } + }, + "address": { + "type": "string", + "id": 2 + } + } + }, + "EthereumSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "nonce": { + "type": "bytes", + "id": 2, + "options": { + "default": "" + } + }, + "gas_price": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "to": { + "type": "string", + "id": 11, + "options": { + "default": "" + } + }, + "value": { + "type": "bytes", + "id": 6, + "options": { + "default": "" + } + }, + "data_initial_chunk": { + "type": "bytes", + "id": 7, + "options": { + "default": "" + } + }, + "data_length": { + "type": "uint32", + "id": 8, + "options": { + "default": 0 + } + }, + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 9 + }, + "tx_type": { + "type": "uint32", + "id": 10 + }, + "definitions": { + "type": "EthereumDefinitions", + "id": 12 + } + } + }, + "EthereumSignTxEIP1559": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "nonce": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "max_gas_fee": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "max_priority_fee": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "gas_limit": { + "rule": "required", + "type": "bytes", + "id": 5 + }, + "to": { + "type": "string", + "id": 6, + "options": { + "default": "" + } + }, + "value": { + "rule": "required", + "type": "bytes", + "id": 7 + }, + "data_initial_chunk": { + "type": "bytes", + "id": 8, + "options": { + "default": "" + } + }, + "data_length": { + "rule": "required", + "type": "uint32", + "id": 9 + }, + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 10 + }, + "access_list": { + "rule": "repeated", + "type": "EthereumAccessList", + "id": 11 + }, + "definitions": { + "type": "EthereumDefinitions", + "id": 12 + } + }, + "nested": { + "EthereumAccessList": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "storage_keys": { + "rule": "repeated", + "type": "bytes", + "id": 2 + } + } + } + } + }, + "EthereumTxRequest": { + "fields": { + "data_length": { + "type": "uint32", + "id": 1 + }, + "signature_v": { + "type": "uint32", + "id": 2 + }, + "signature_r": { + "type": "bytes", + "id": 3 + }, + "signature_s": { + "type": "bytes", + "id": 4 + } + } + }, + "EthereumTxAck": { + "fields": { + "data_chunk": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "EthereumSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "encoded_network": { + "type": "bytes", + "id": 3 + } + } + }, + "EthereumMessageSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "address": { + "rule": "required", + "type": "string", + "id": 3 + } + } + }, + "EthereumVerifyMessage": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "address": { + "rule": "required", + "type": "string", + "id": 4 + } + } + }, + "EthereumSignTypedHash": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "domain_separator_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "message_hash": { + "type": "bytes", + "id": 3 + }, + "encoded_network": { + "type": "bytes", + "id": 4 + } + } + }, + "EthereumTypedDataSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "address": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "BackupType": { + "values": { + "Bip39": 0, + "Slip39_Basic": 1, + "Slip39_Advanced": 2 + } + }, + "SafetyCheckLevel": { + "values": { + "Strict": 0, + "PromptAlways": 1, + "PromptTemporarily": 2 + } + }, + "HomescreenFormat": { + "values": { + "Toif": 1, + "Jpeg": 2, + "ToiG": 3 + } + }, + "Initialize": { + "fields": { + "session_id": { + "type": "bytes", + "id": 1 + }, + "_skip_passphrase": { + "type": "bool", + "id": 2, + "options": { + "deprecated": true + } + }, + "derive_cardano": { + "type": "bool", + "id": 3 + } + } + }, + "GetFeatures": { + "fields": {} + }, + "Features": { + "fields": { + "vendor": { + "type": "string", + "id": 1 + }, + "major_version": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "minor_version": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "patch_version": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "bootloader_mode": { + "type": "bool", + "id": 5 + }, + "device_id": { + "type": "string", + "id": 6 + }, + "pin_protection": { + "type": "bool", + "id": 7 + }, + "passphrase_protection": { + "type": "bool", + "id": 8 + }, + "language": { + "type": "string", + "id": 9 + }, + "label": { + "type": "string", + "id": 10 + }, + "initialized": { + "type": "bool", + "id": 12 + }, + "revision": { + "type": "bytes", + "id": 13 + }, + "bootloader_hash": { + "type": "bytes", + "id": 14 + }, + "imported": { + "type": "bool", + "id": 15 + }, + "unlocked": { + "type": "bool", + "id": 16 + }, + "_passphrase_cached": { + "type": "bool", + "id": 17, + "options": { + "deprecated": true + } + }, + "firmware_present": { + "type": "bool", + "id": 18 + }, + "needs_backup": { + "type": "bool", + "id": 19 + }, + "flags": { + "type": "uint32", + "id": 20 + }, + "model": { + "type": "string", + "id": 21 + }, + "fw_major": { + "type": "uint32", + "id": 22 + }, + "fw_minor": { + "type": "uint32", + "id": 23 + }, + "fw_patch": { + "type": "uint32", + "id": 24 + }, + "fw_vendor": { + "type": "string", + "id": 25 + }, + "unfinished_backup": { + "type": "bool", + "id": 27 + }, + "no_backup": { + "type": "bool", + "id": 28 + }, + "recovery_mode": { + "type": "bool", + "id": 29 + }, + "capabilities": { + "rule": "repeated", + "type": "Capability", + "id": 30, + "options": { + "packed": false + } + }, + "backup_type": { + "type": "BackupType", + "id": 31 + }, + "sd_card_present": { + "type": "bool", + "id": 32 + }, + "sd_protection": { + "type": "bool", + "id": 33 + }, + "wipe_code_protection": { + "type": "bool", + "id": 34 + }, + "session_id": { + "type": "bytes", + "id": 35 + }, + "passphrase_always_on_device": { + "type": "bool", + "id": 36 + }, + "safety_checks": { + "type": "SafetyCheckLevel", + "id": 37 + }, + "auto_lock_delay_ms": { + "type": "uint32", + "id": 38 + }, + "display_rotation": { + "type": "uint32", + "id": 39 + }, + "experimental_features": { + "type": "bool", + "id": 40 + }, + "busy": { + "type": "bool", + "id": 41 + }, + "homescreen_format": { + "type": "HomescreenFormat", + "id": 42 + }, + "hide_passphrase_from_host": { + "type": "bool", + "id": 43 + }, + "internal_model": { + "type": "string", + "id": 44 + }, + "unit_color": { + "type": "uint32", + "id": 45 + }, + "unit_btconly": { + "type": "bool", + "id": 46 + }, + "homescreen_width": { + "type": "uint32", + "id": 47 + }, + "homescreen_height": { + "type": "uint32", + "id": 48 + } + }, + "nested": { + "Capability": { + "options": { + "(has_bitcoin_only_values)": true + }, + "valuesOptions": { + "Capability_Bitcoin": { + "(bitcoin_only)": true + }, + "Capability_Crypto": { + "(bitcoin_only)": true + }, + "Capability_Lisk": { + "deprecated": true + }, + "Capability_Shamir": { + "(bitcoin_only)": true + }, + "Capability_ShamirGroups": { + "(bitcoin_only)": true + }, + "Capability_PassphraseEntry": { + "(bitcoin_only)": true + } + }, + "values": { + "Capability_Bitcoin": 1, + "Capability_Bitcoin_like": 2, + "Capability_Binance": 3, + "Capability_Cardano": 4, + "Capability_Crypto": 5, + "Capability_EOS": 6, + "Capability_Ethereum": 7, + "Capability_Lisk": 8, + "Capability_Monero": 9, + "Capability_NEM": 10, + "Capability_Ripple": 11, + "Capability_Stellar": 12, + "Capability_Tezos": 13, + "Capability_U2F": 14, + "Capability_Shamir": 15, + "Capability_ShamirGroups": 16, + "Capability_PassphraseEntry": 17 + } + } + } + }, + "LockDevice": { + "fields": {} + }, + "SetBusy": { + "fields": { + "expiry_ms": { + "type": "uint32", + "id": 1 + } + } + }, + "EndSession": { + "fields": {} + }, + "ApplySettings": { + "fields": { + "language": { + "type": "string", + "id": 1 + }, + "label": { + "type": "string", + "id": 2 + }, + "use_passphrase": { + "type": "bool", + "id": 3 + }, + "homescreen": { + "type": "bytes", + "id": 4 + }, + "_passphrase_source": { + "type": "uint32", + "id": 5, + "options": { + "deprecated": true + } + }, + "auto_lock_delay_ms": { + "type": "uint32", + "id": 6 + }, + "display_rotation": { + "type": "uint32", + "id": 7 + }, + "passphrase_always_on_device": { + "type": "bool", + "id": 8 + }, + "safety_checks": { + "type": "SafetyCheckLevel", + "id": 9 + }, + "experimental_features": { + "type": "bool", + "id": 10 + }, + "hide_passphrase_from_host": { + "type": "bool", + "id": 11 + } + } + }, + "ApplyFlags": { + "fields": { + "flags": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "ChangePin": { + "fields": { + "remove": { + "type": "bool", + "id": 1 + } + } + }, + "ChangeWipeCode": { + "fields": { + "remove": { + "type": "bool", + "id": 1 + } + } + }, + "SdProtect": { + "fields": { + "operation": { + "rule": "required", + "type": "SdProtectOperationType", + "id": 1 + } + }, + "nested": { + "SdProtectOperationType": { + "values": { + "DISABLE": 0, + "ENABLE": 1, + "REFRESH": 2 + } + } + } + }, + "Ping": { + "fields": { + "message": { + "type": "string", + "id": 1, + "options": { + "default": "" + } + }, + "button_protection": { + "type": "bool", + "id": 2 + } + } + }, + "Cancel": { + "fields": {} + }, + "GetEntropy": { + "fields": { + "size": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "Entropy": { + "fields": { + "entropy": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "GetFirmwareHash": { + "fields": { + "challenge": { + "type": "bytes", + "id": 1 + } + } + }, + "FirmwareHash": { + "fields": { + "hash": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "AuthenticateDevice": { + "fields": { + "challenge": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "AuthenticityProof": { + "fields": { + "certificates": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "WipeDevice": { + "fields": {} + }, + "LoadDevice": { + "fields": { + "mnemonics": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "pin": { + "type": "string", + "id": 3 + }, + "passphrase_protection": { + "type": "bool", + "id": 4 + }, + "language": { + "type": "string", + "id": 5, + "options": { + "default": "en-US" + } + }, + "label": { + "type": "string", + "id": 6 + }, + "skip_checksum": { + "type": "bool", + "id": 7 + }, + "u2f_counter": { + "type": "uint32", + "id": 8 + }, + "needs_backup": { + "type": "bool", + "id": 9 + }, + "no_backup": { + "type": "bool", + "id": 10 + } + } + }, + "ResetDevice": { + "fields": { + "display_random": { + "type": "bool", + "id": 1 + }, + "strength": { + "type": "uint32", + "id": 2, + "options": { + "default": 256 + } + }, + "passphrase_protection": { + "type": "bool", + "id": 3 + }, + "pin_protection": { + "type": "bool", + "id": 4 + }, + "language": { + "type": "string", + "id": 5, + "options": { + "default": "en-US" + } + }, + "label": { + "type": "string", + "id": 6 + }, + "u2f_counter": { + "type": "uint32", + "id": 7 + }, + "skip_backup": { + "type": "bool", + "id": 8 + }, + "no_backup": { + "type": "bool", + "id": 9 + }, + "backup_type": { + "type": "BackupType", + "id": 10, + "options": { + "default": "Bip39" + } + } + } + }, + "BackupDevice": { + "fields": {} + }, + "EntropyRequest": { + "fields": {} + }, + "EntropyAck": { + "fields": { + "entropy": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "RecoveryDevice": { + "fields": { + "word_count": { + "type": "uint32", + "id": 1 + }, + "passphrase_protection": { + "type": "bool", + "id": 2 + }, + "pin_protection": { + "type": "bool", + "id": 3 + }, + "language": { + "type": "string", + "id": 4 + }, + "label": { + "type": "string", + "id": 5 + }, + "enforce_wordlist": { + "type": "bool", + "id": 6 + }, + "type": { + "type": "RecoveryDeviceType", + "id": 8 + }, + "u2f_counter": { + "type": "uint32", + "id": 9 + }, + "dry_run": { + "type": "bool", + "id": 10 + } + }, + "nested": { + "RecoveryDeviceType": { + "values": { + "RecoveryDeviceType_ScrambledWords": 0, + "RecoveryDeviceType_Matrix": 1 + } + } + } + }, + "WordRequest": { + "fields": { + "type": { + "rule": "required", + "type": "WordRequestType", + "id": 1 + } + }, + "nested": { + "WordRequestType": { + "values": { + "WordRequestType_Plain": 0, + "WordRequestType_Matrix9": 1, + "WordRequestType_Matrix6": 2 + } + } + } + }, + "WordAck": { + "fields": { + "word": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "SetU2FCounter": { + "fields": { + "u2f_counter": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "GetNextU2FCounter": { + "fields": {} + }, + "NextU2FCounter": { + "fields": { + "u2f_counter": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "DoPreauthorized": { + "fields": {} + }, + "PreauthorizedRequest": { + "fields": {} + }, + "CancelAuthorization": { + "fields": {} + }, + "RebootToBootloader": { + "fields": {} + }, + "GetNonce": { + "options": { + "(experimental_message)": true + }, + "fields": {} + }, + "Nonce": { + "options": { + "(experimental_message)": true + }, + "fields": { + "nonce": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "UnlockPath": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "mac": { + "type": "bytes", + "id": 2 + } + } + }, + "UnlockedPathRequest": { + "fields": { + "mac": { + "type": "bytes", + "id": 1 + } + } + }, + "ShowDeviceTutorial": { + "fields": {} + }, + "UnlockBootloader": { + "fields": {} + }, + "MoneroNetworkType": { + "values": { + "MAINNET": 0, + "TESTNET": 1, + "STAGENET": 2, + "FAKECHAIN": 3 + } + }, + "MoneroTransactionSourceEntry": { + "fields": { + "outputs": { + "rule": "repeated", + "type": "MoneroOutputEntry", + "id": 1 + }, + "real_output": { + "type": "uint64", + "id": 2 + }, + "real_out_tx_key": { + "type": "bytes", + "id": 3 + }, + "real_out_additional_tx_keys": { + "rule": "repeated", + "type": "bytes", + "id": 4 + }, + "real_output_in_tx_index": { + "type": "uint64", + "id": 5 + }, + "amount": { + "type": "uint64", + "id": 6 + }, + "rct": { + "type": "bool", + "id": 7 + }, + "mask": { + "type": "bytes", + "id": 8 + }, + "multisig_kLRki": { + "type": "MoneroMultisigKLRki", + "id": 9 + }, + "subaddr_minor": { + "type": "uint32", + "id": 10 + } + }, + "nested": { + "MoneroOutputEntry": { + "fields": { + "idx": { + "type": "uint64", + "id": 1 + }, + "key": { + "type": "MoneroRctKeyPublic", + "id": 2 + } + }, + "nested": { + "MoneroRctKeyPublic": { + "fields": { + "dest": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "commitment": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + } + } + }, + "MoneroMultisigKLRki": { + "fields": { + "K": { + "type": "bytes", + "id": 1 + }, + "L": { + "type": "bytes", + "id": 2 + }, + "R": { + "type": "bytes", + "id": 3 + }, + "ki": { + "type": "bytes", + "id": 4 + } + } + } + } + }, + "MoneroTransactionDestinationEntry": { + "fields": { + "amount": { + "type": "uint64", + "id": 1 + }, + "addr": { + "type": "MoneroAccountPublicAddress", + "id": 2 + }, + "is_subaddress": { + "type": "bool", + "id": 3 + }, + "original": { + "type": "bytes", + "id": 4 + }, + "is_integrated": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "MoneroAccountPublicAddress": { + "fields": { + "spend_public_key": { + "type": "bytes", + "id": 1 + }, + "view_public_key": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "MoneroTransactionRsigData": { + "fields": { + "rsig_type": { + "type": "uint32", + "id": 1 + }, + "offload_type": { + "type": "uint32", + "id": 2 + }, + "grouping": { + "rule": "repeated", + "type": "uint64", + "id": 3, + "options": { + "packed": false + } + }, + "mask": { + "type": "bytes", + "id": 4 + }, + "rsig": { + "type": "bytes", + "id": 5 + }, + "rsig_parts": { + "rule": "repeated", + "type": "bytes", + "id": 6 + }, + "bp_version": { + "type": "uint32", + "id": 7 + } + } + }, + "MoneroGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "network_type": { + "type": "MoneroNetworkType", + "id": 3, + "options": { + "default": "MAINNET" + } + }, + "account": { + "type": "uint32", + "id": 4 + }, + "minor": { + "type": "uint32", + "id": 5 + }, + "payment_id": { + "type": "bytes", + "id": 6 + } + } + }, + "MoneroAddress": { + "fields": { + "address": { + "type": "bytes", + "id": 1 + } + } + }, + "MoneroGetWatchKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network_type": { + "type": "MoneroNetworkType", + "id": 2, + "options": { + "default": "MAINNET" + } + } + } + }, + "MoneroWatchKey": { + "fields": { + "watch_key": { + "type": "bytes", + "id": 1 + }, + "address": { + "type": "bytes", + "id": 2 + } + } + }, + "MoneroTransactionInitRequest": { + "fields": { + "version": { + "type": "uint32", + "id": 1 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "network_type": { + "type": "MoneroNetworkType", + "id": 3, + "options": { + "default": "MAINNET" + } + }, + "tsx_data": { + "type": "MoneroTransactionData", + "id": 4 + } + }, + "nested": { + "MoneroTransactionData": { + "fields": { + "version": { + "type": "uint32", + "id": 1 + }, + "payment_id": { + "type": "bytes", + "id": 2 + }, + "unlock_time": { + "type": "uint64", + "id": 3 + }, + "outputs": { + "rule": "repeated", + "type": "MoneroTransactionDestinationEntry", + "id": 4 + }, + "change_dts": { + "type": "MoneroTransactionDestinationEntry", + "id": 5 + }, + "num_inputs": { + "type": "uint32", + "id": 6 + }, + "mixin": { + "type": "uint32", + "id": 7 + }, + "fee": { + "type": "uint64", + "id": 8 + }, + "account": { + "type": "uint32", + "id": 9 + }, + "minor_indices": { + "rule": "repeated", + "type": "uint32", + "id": 10, + "options": { + "packed": false + } + }, + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 11 + }, + "integrated_indices": { + "rule": "repeated", + "type": "uint32", + "id": 12, + "options": { + "packed": false + } + }, + "client_version": { + "type": "uint32", + "id": 13 + }, + "hard_fork": { + "type": "uint32", + "id": 14 + }, + "monero_version": { + "type": "bytes", + "id": 15 + } + } + } + } + }, + "MoneroTransactionInitAck": { + "fields": { + "hmacs": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 2 + } + } + }, + "MoneroTransactionSetInputRequest": { + "fields": { + "src_entr": { + "type": "MoneroTransactionSourceEntry", + "id": 1 + } + } + }, + "MoneroTransactionSetInputAck": { + "fields": { + "vini": { + "type": "bytes", + "id": 1 + }, + "vini_hmac": { + "type": "bytes", + "id": 2 + }, + "pseudo_out": { + "type": "bytes", + "id": 3 + }, + "pseudo_out_hmac": { + "type": "bytes", + "id": 4 + }, + "pseudo_out_alpha": { + "type": "bytes", + "id": 5 + }, + "spend_key": { + "type": "bytes", + "id": 6 + } + } + }, + "MoneroTransactionInputViniRequest": { + "fields": { + "src_entr": { + "type": "MoneroTransactionSourceEntry", + "id": 1 + }, + "vini": { + "type": "bytes", + "id": 2 + }, + "vini_hmac": { + "type": "bytes", + "id": 3 + }, + "pseudo_out": { + "type": "bytes", + "id": 4 + }, + "pseudo_out_hmac": { + "type": "bytes", + "id": 5 + }, + "orig_idx": { + "type": "uint32", + "id": 6 + } + } + }, + "MoneroTransactionInputViniAck": { + "fields": {} + }, + "MoneroTransactionAllInputsSetRequest": { + "fields": {} + }, + "MoneroTransactionAllInputsSetAck": { + "fields": { + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 1 + } + } + }, + "MoneroTransactionSetOutputRequest": { + "fields": { + "dst_entr": { + "type": "MoneroTransactionDestinationEntry", + "id": 1 + }, + "dst_entr_hmac": { + "type": "bytes", + "id": 2 + }, + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 3 + }, + "is_offloaded_bp": { + "type": "bool", + "id": 4 + } + } + }, + "MoneroTransactionSetOutputAck": { + "fields": { + "tx_out": { + "type": "bytes", + "id": 1 + }, + "vouti_hmac": { + "type": "bytes", + "id": 2 + }, + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 3 + }, + "out_pk": { + "type": "bytes", + "id": 4 + }, + "ecdh_info": { + "type": "bytes", + "id": 5 + } + } + }, + "MoneroTransactionAllOutSetRequest": { + "fields": { + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 1 + } + } + }, + "MoneroTransactionAllOutSetAck": { + "fields": { + "extra": { + "type": "bytes", + "id": 1 + }, + "tx_prefix_hash": { + "type": "bytes", + "id": 2 + }, + "rv": { + "type": "MoneroRingCtSig", + "id": 4 + }, + "full_message_hash": { + "type": "bytes", + "id": 5 + } + }, + "nested": { + "MoneroRingCtSig": { + "fields": { + "txn_fee": { + "type": "uint64", + "id": 1 + }, + "message": { + "type": "bytes", + "id": 2 + }, + "rv_type": { + "type": "uint32", + "id": 3 + } + } + } + } + }, + "MoneroTransactionSignInputRequest": { + "fields": { + "src_entr": { + "type": "MoneroTransactionSourceEntry", + "id": 1 + }, + "vini": { + "type": "bytes", + "id": 2 + }, + "vini_hmac": { + "type": "bytes", + "id": 3 + }, + "pseudo_out": { + "type": "bytes", + "id": 4 + }, + "pseudo_out_hmac": { + "type": "bytes", + "id": 5 + }, + "pseudo_out_alpha": { + "type": "bytes", + "id": 6 + }, + "spend_key": { + "type": "bytes", + "id": 7 + }, + "orig_idx": { + "type": "uint32", + "id": 8 + } + } + }, + "MoneroTransactionSignInputAck": { + "fields": { + "signature": { + "type": "bytes", + "id": 1 + }, + "pseudo_out": { + "type": "bytes", + "id": 2 + } + } + }, + "MoneroTransactionFinalRequest": { + "fields": {} + }, + "MoneroTransactionFinalAck": { + "fields": { + "cout_key": { + "type": "bytes", + "id": 1 + }, + "salt": { + "type": "bytes", + "id": 2 + }, + "rand_mult": { + "type": "bytes", + "id": 3 + }, + "tx_enc_keys": { + "type": "bytes", + "id": 4 + }, + "opening_key": { + "type": "bytes", + "id": 5 + } + } + }, + "MoneroKeyImageExportInitRequest": { + "fields": { + "num": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 3, + "options": { + "packed": false + } + }, + "network_type": { + "type": "MoneroNetworkType", + "id": 4, + "options": { + "default": "MAINNET" + } + }, + "subs": { + "rule": "repeated", + "type": "MoneroSubAddressIndicesList", + "id": 5 + } + }, + "nested": { + "MoneroSubAddressIndicesList": { + "fields": { + "account": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "minor_indices": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + } + } + } + } + }, + "MoneroKeyImageExportInitAck": { + "fields": {} + }, + "MoneroKeyImageSyncStepRequest": { + "fields": { + "tdis": { + "rule": "repeated", + "type": "MoneroTransferDetails", + "id": 1 + } + }, + "nested": { + "MoneroTransferDetails": { + "fields": { + "out_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "tx_pub_key": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "additional_tx_pub_keys": { + "rule": "repeated", + "type": "bytes", + "id": 3 + }, + "internal_output_index": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "sub_addr_major": { + "type": "uint32", + "id": 5 + }, + "sub_addr_minor": { + "type": "uint32", + "id": 6 + } + } + } + } + }, + "MoneroKeyImageSyncStepAck": { + "fields": { + "kis": { + "rule": "repeated", + "type": "MoneroExportedKeyImage", + "id": 1 + } + }, + "nested": { + "MoneroExportedKeyImage": { + "fields": { + "iv": { + "type": "bytes", + "id": 1 + }, + "blob": { + "type": "bytes", + "id": 3 + } + } + } + } + }, + "MoneroKeyImageSyncFinalRequest": { + "fields": {} + }, + "MoneroKeyImageSyncFinalAck": { + "fields": { + "enc_key": { + "type": "bytes", + "id": 1 + } + } + }, + "MoneroGetTxKeyRequest": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network_type": { + "type": "MoneroNetworkType", + "id": 2, + "options": { + "default": "MAINNET" + } + }, + "salt1": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "salt2": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "tx_enc_keys": { + "rule": "required", + "type": "bytes", + "id": 5 + }, + "tx_prefix_hash": { + "rule": "required", + "type": "bytes", + "id": 6 + }, + "reason": { + "type": "uint32", + "id": 7 + }, + "view_public_key": { + "type": "bytes", + "id": 8 + } + } + }, + "MoneroGetTxKeyAck": { + "fields": { + "salt": { + "type": "bytes", + "id": 1 + }, + "tx_keys": { + "type": "bytes", + "id": 2 + }, + "tx_derivations": { + "type": "bytes", + "id": 3 + } + } + }, + "MoneroLiveRefreshStartRequest": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network_type": { + "type": "MoneroNetworkType", + "id": 2, + "options": { + "default": "MAINNET" + } + } + } + }, + "MoneroLiveRefreshStartAck": { + "fields": {} + }, + "MoneroLiveRefreshStepRequest": { + "fields": { + "out_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "recv_deriv": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "real_out_idx": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "sub_addr_major": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "sub_addr_minor": { + "rule": "required", + "type": "uint32", + "id": 5 + } + } + }, + "MoneroLiveRefreshStepAck": { + "fields": { + "salt": { + "type": "bytes", + "id": 1 + }, + "key_image": { + "type": "bytes", + "id": 2 + } + } + }, + "MoneroLiveRefreshFinalRequest": { + "fields": {} + }, + "MoneroLiveRefreshFinalAck": { + "fields": {} + }, + "DebugMoneroDiagRequest": { + "fields": { + "ins": { + "type": "uint64", + "id": 1 + }, + "p1": { + "type": "uint64", + "id": 2 + }, + "p2": { + "type": "uint64", + "id": 3 + }, + "pd": { + "rule": "repeated", + "type": "uint64", + "id": 4, + "options": { + "packed": false + } + }, + "data1": { + "type": "bytes", + "id": 5 + }, + "data2": { + "type": "bytes", + "id": 6 + } + } + }, + "DebugMoneroDiagAck": { + "fields": { + "ins": { + "type": "uint64", + "id": 1 + }, + "p1": { + "type": "uint64", + "id": 2 + }, + "p2": { + "type": "uint64", + "id": 3 + }, + "pd": { + "rule": "repeated", + "type": "uint64", + "id": 4, + "options": { + "packed": false + } + }, + "data1": { + "type": "bytes", + "id": 5 + }, + "data2": { + "type": "bytes", + "id": 6 + } + } + }, + "NEMGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network": { + "type": "uint32", + "id": 2, + "options": { + "default": 104 + } + }, + "show_display": { + "type": "bool", + "id": 3 + } + } + }, + "NEMAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "NEMSignTx": { + "fields": { + "transaction": { + "rule": "required", + "type": "NEMTransactionCommon", + "id": 1 + }, + "multisig": { + "type": "NEMTransactionCommon", + "id": 2 + }, + "transfer": { + "type": "NEMTransfer", + "id": 3 + }, + "cosigning": { + "type": "bool", + "id": 4 + }, + "provision_namespace": { + "type": "NEMProvisionNamespace", + "id": 5 + }, + "mosaic_creation": { + "type": "NEMMosaicCreation", + "id": 6 + }, + "supply_change": { + "type": "NEMMosaicSupplyChange", + "id": 7 + }, + "aggregate_modification": { + "type": "NEMAggregateModification", + "id": 8 + }, + "importance_transfer": { + "type": "NEMImportanceTransfer", + "id": 9 + } + }, + "nested": { + "NEMTransactionCommon": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network": { + "type": "uint32", + "id": 2, + "options": { + "default": 104 + } + }, + "timestamp": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "deadline": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "signer": { + "type": "bytes", + "id": 6 + } + } + }, + "NEMTransfer": { + "fields": { + "recipient": { + "rule": "required", + "type": "string", + "id": 1 + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "payload": { + "type": "bytes", + "id": 3 + }, + "public_key": { + "type": "bytes", + "id": 4 + }, + "mosaics": { + "rule": "repeated", + "type": "NEMMosaic", + "id": 5 + } + }, + "nested": { + "NEMMosaic": { + "fields": { + "namespace": { + "rule": "required", + "type": "string", + "id": 1 + }, + "mosaic": { + "rule": "required", + "type": "string", + "id": 2 + }, + "quantity": { + "rule": "required", + "type": "uint64", + "id": 3 + } + } + } + } + }, + "NEMProvisionNamespace": { + "fields": { + "namespace": { + "rule": "required", + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "sink": { + "rule": "required", + "type": "string", + "id": 3 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 4 + } + } + }, + "NEMMosaicCreation": { + "fields": { + "definition": { + "rule": "required", + "type": "NEMMosaicDefinition", + "id": 1 + }, + "sink": { + "rule": "required", + "type": "string", + "id": 2 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 3 + } + }, + "nested": { + "NEMMosaicDefinition": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ticker": { + "type": "string", + "id": 2 + }, + "namespace": { + "rule": "required", + "type": "string", + "id": 3 + }, + "mosaic": { + "rule": "required", + "type": "string", + "id": 4 + }, + "divisibility": { + "type": "uint32", + "id": 5 + }, + "levy": { + "type": "NEMMosaicLevy", + "id": 6 + }, + "fee": { + "type": "uint64", + "id": 7 + }, + "levy_address": { + "type": "string", + "id": 8 + }, + "levy_namespace": { + "type": "string", + "id": 9 + }, + "levy_mosaic": { + "type": "string", + "id": 10 + }, + "supply": { + "type": "uint64", + "id": 11 + }, + "mutable_supply": { + "type": "bool", + "id": 12 + }, + "transferable": { + "type": "bool", + "id": 13 + }, + "description": { + "rule": "required", + "type": "string", + "id": 14 + }, + "networks": { + "rule": "repeated", + "type": "uint32", + "id": 15, + "options": { + "packed": false + } + } + }, + "nested": { + "NEMMosaicLevy": { + "values": { + "MosaicLevy_Absolute": 1, + "MosaicLevy_Percentile": 2 + } + } + } + } + } + }, + "NEMMosaicSupplyChange": { + "fields": { + "namespace": { + "rule": "required", + "type": "string", + "id": 1 + }, + "mosaic": { + "rule": "required", + "type": "string", + "id": 2 + }, + "type": { + "rule": "required", + "type": "NEMSupplyChangeType", + "id": 3 + }, + "delta": { + "rule": "required", + "type": "uint64", + "id": 4 + } + }, + "nested": { + "NEMSupplyChangeType": { + "values": { + "SupplyChange_Increase": 1, + "SupplyChange_Decrease": 2 + } + } + } + }, + "NEMAggregateModification": { + "fields": { + "modifications": { + "rule": "repeated", + "type": "NEMCosignatoryModification", + "id": 1 + }, + "relative_change": { + "type": "sint32", + "id": 2 + } + }, + "nested": { + "NEMCosignatoryModification": { + "fields": { + "type": { + "rule": "required", + "type": "NEMModificationType", + "id": 1 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + } + }, + "nested": { + "NEMModificationType": { + "values": { + "CosignatoryModification_Add": 1, + "CosignatoryModification_Delete": 2 + } + } + } + } + } + }, + "NEMImportanceTransfer": { + "fields": { + "mode": { + "rule": "required", + "type": "NEMImportanceTransferMode", + "id": 1 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + } + }, + "nested": { + "NEMImportanceTransferMode": { + "values": { + "ImportanceTransfer_Activate": 1, + "ImportanceTransfer_Deactivate": 2 + } + } + } + } + } + }, + "NEMSignedTx": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "NEMDecryptMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network": { + "type": "uint32", + "id": 2 + }, + "public_key": { + "type": "bytes", + "id": 3 + }, + "payload": { + "type": "bytes", + "id": 4 + } + } + }, + "NEMDecryptedMessage": { + "fields": { + "payload": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "wire_in": { + "type": "bool", + "id": 50002, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_out": { + "type": "bool", + "id": 50003, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_debug_in": { + "type": "bool", + "id": 50004, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_debug_out": { + "type": "bool", + "id": 50005, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_tiny": { + "type": "bool", + "id": 50006, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_bootloader": { + "type": "bool", + "id": 50007, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_no_fsm": { + "type": "bool", + "id": 50008, + "extend": "google.protobuf.EnumValueOptions" + }, + "bitcoin_only": { + "type": "bool", + "id": 60000, + "extend": "google.protobuf.EnumValueOptions" + }, + "has_bitcoin_only_values": { + "type": "bool", + "id": 51001, + "extend": "google.protobuf.EnumOptions" + }, + "experimental_message": { + "type": "bool", + "id": 52001, + "extend": "google.protobuf.MessageOptions" + }, + "wire_type": { + "type": "uint32", + "id": 52002, + "extend": "google.protobuf.MessageOptions" + }, + "experimental_field": { + "type": "bool", + "id": 53001, + "extend": "google.protobuf.FieldOptions" + }, + "include_in_bitcoin_only": { + "type": "bool", + "id": 60000, + "extend": "google.protobuf.FileOptions" + }, + "MessageType": { + "options": { + "(has_bitcoin_only_values)": true + }, + "valuesOptions": { + "MessageType_Initialize": { + "(bitcoin_only)": true, + "(wire_in)": true, + "(wire_tiny)": true + }, + "MessageType_Ping": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_Success": { + "(bitcoin_only)": true, + "(wire_out)": true, + "(wire_debug_out)": true + }, + "MessageType_Failure": { + "(bitcoin_only)": true, + "(wire_out)": true, + "(wire_debug_out)": true + }, + "MessageType_ChangePin": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_WipeDevice": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_GetEntropy": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_Entropy": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_LoadDevice": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_ResetDevice": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_SetBusy": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_Features": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_PinMatrixRequest": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_PinMatrixAck": { + "(bitcoin_only)": true, + "(wire_in)": true, + "(wire_tiny)": true, + "(wire_no_fsm)": true + }, + "MessageType_Cancel": { + "(bitcoin_only)": true, + "(wire_in)": true, + "(wire_tiny)": true + }, + "MessageType_LockDevice": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_ApplySettings": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_ButtonRequest": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_ButtonAck": { + "(bitcoin_only)": true, + "(wire_in)": true, + "(wire_tiny)": true, + "(wire_no_fsm)": true + }, + "MessageType_ApplyFlags": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_GetNonce": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_Nonce": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_BackupDevice": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_EntropyRequest": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_EntropyAck": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_PassphraseRequest": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_PassphraseAck": { + "(bitcoin_only)": true, + "(wire_in)": true, + "(wire_tiny)": true, + "(wire_no_fsm)": true + }, + "MessageType_RecoveryDevice": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_WordRequest": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_WordAck": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_GetFeatures": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_SdProtect": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_ChangeWipeCode": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_EndSession": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_DoPreauthorized": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_PreauthorizedRequest": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_CancelAuthorization": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_RebootToBootloader": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_GetFirmwareHash": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_FirmwareHash": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_UnlockPath": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_UnlockedPathRequest": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_ShowDeviceTutorial": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_UnlockBootloader": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_AuthenticateDevice": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_AuthenticityProof": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_SetU2FCounter": { + "(wire_in)": true + }, + "MessageType_GetNextU2FCounter": { + "(wire_in)": true + }, + "MessageType_NextU2FCounter": { + "(wire_out)": true + }, + "MessageType_Deprecated_PassphraseStateRequest": { + "deprecated": true + }, + "MessageType_Deprecated_PassphraseStateAck": { + "deprecated": true + }, + "MessageType_FirmwareErase": { + "(bitcoin_only)": true, + "(wire_in)": true, + "(wire_bootloader)": true + }, + "MessageType_FirmwareUpload": { + "(bitcoin_only)": true, + "(wire_in)": true, + "(wire_bootloader)": true + }, + "MessageType_FirmwareRequest": { + "(bitcoin_only)": true, + "(wire_out)": true, + "(wire_bootloader)": true + }, + "MessageType_SelfTest": { + "(bitcoin_only)": true, + "(wire_in)": true, + "(wire_bootloader)": true + }, + "MessageType_GetPublicKey": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_PublicKey": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_SignTx": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_TxRequest": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_TxAck": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_GetAddress": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_Address": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_TxAckPaymentRequest": { + "(wire_in)": true + }, + "MessageType_SignMessage": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_VerifyMessage": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_MessageSignature": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_GetOwnershipId": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_OwnershipId": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_GetOwnershipProof": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_OwnershipProof": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_AuthorizeCoinJoin": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_CipherKeyValue": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_CipheredKeyValue": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_SignIdentity": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_SignedIdentity": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_GetECDHSessionKey": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_ECDHSessionKey": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_CosiCommit": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_CosiCommitment": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_CosiSign": { + "(bitcoin_only)": true, + "(wire_in)": true + }, + "MessageType_CosiSignature": { + "(bitcoin_only)": true, + "(wire_out)": true + }, + "MessageType_DebugLinkDecision": { + "(bitcoin_only)": true, + "(wire_debug_in)": true, + "(wire_tiny)": true, + "(wire_no_fsm)": true + }, + "MessageType_DebugLinkGetState": { + "(bitcoin_only)": true, + "(wire_debug_in)": true, + "(wire_tiny)": true + }, + "MessageType_DebugLinkState": { + "(bitcoin_only)": true, + "(wire_debug_out)": true + }, + "MessageType_DebugLinkStop": { + "(bitcoin_only)": true, + "(wire_debug_in)": true + }, + "MessageType_DebugLinkLog": { + "(bitcoin_only)": true, + "(wire_debug_out)": true + }, + "MessageType_DebugLinkMemoryRead": { + "(bitcoin_only)": true, + "(wire_debug_in)": true + }, + "MessageType_DebugLinkMemory": { + "(bitcoin_only)": true, + "(wire_debug_out)": true + }, + "MessageType_DebugLinkMemoryWrite": { + "(bitcoin_only)": true, + "(wire_debug_in)": true + }, + "MessageType_DebugLinkFlashErase": { + "(bitcoin_only)": true, + "(wire_debug_in)": true + }, + "MessageType_DebugLinkLayout": { + "(bitcoin_only)": true, + "(wire_debug_out)": true + }, + "MessageType_DebugLinkReseedRandom": { + "(bitcoin_only)": true, + "(wire_debug_in)": true + }, + "MessageType_DebugLinkRecordScreen": { + "(bitcoin_only)": true, + "(wire_debug_in)": true + }, + "MessageType_DebugLinkEraseSdCard": { + "(bitcoin_only)": true, + "(wire_debug_in)": true + }, + "MessageType_DebugLinkWatchLayout": { + "(bitcoin_only)": true, + "(wire_debug_in)": true + }, + "MessageType_DebugLinkResetDebugEvents": { + "(bitcoin_only)": true, + "(wire_debug_in)": true + }, + "MessageType_EthereumGetPublicKey": { + "(wire_in)": true + }, + "MessageType_EthereumPublicKey": { + "(wire_out)": true + }, + "MessageType_EthereumGetAddress": { + "(wire_in)": true + }, + "MessageType_EthereumAddress": { + "(wire_out)": true + }, + "MessageType_EthereumSignTx": { + "(wire_in)": true + }, + "MessageType_EthereumSignTxEIP1559": { + "(wire_in)": true + }, + "MessageType_EthereumTxRequest": { + "(wire_out)": true + }, + "MessageType_EthereumTxAck": { + "(wire_in)": true + }, + "MessageType_EthereumSignMessage": { + "(wire_in)": true + }, + "MessageType_EthereumVerifyMessage": { + "(wire_in)": true + }, + "MessageType_EthereumMessageSignature": { + "(wire_out)": true + }, + "MessageType_EthereumSignTypedData": { + "(wire_in)": true + }, + "MessageType_EthereumTypedDataStructRequest": { + "(wire_out)": true + }, + "MessageType_EthereumTypedDataStructAck": { + "(wire_in)": true + }, + "MessageType_EthereumTypedDataValueRequest": { + "(wire_out)": true + }, + "MessageType_EthereumTypedDataValueAck": { + "(wire_in)": true + }, + "MessageType_EthereumTypedDataSignature": { + "(wire_out)": true + }, + "MessageType_EthereumSignTypedHash": { + "(wire_in)": true + }, + "MessageType_NEMGetAddress": { + "(wire_in)": true + }, + "MessageType_NEMAddress": { + "(wire_out)": true + }, + "MessageType_NEMSignTx": { + "(wire_in)": true + }, + "MessageType_NEMSignedTx": { + "(wire_out)": true + }, + "MessageType_NEMDecryptMessage": { + "(wire_in)": true + }, + "MessageType_NEMDecryptedMessage": { + "(wire_out)": true + }, + "MessageType_TezosGetAddress": { + "(wire_in)": true + }, + "MessageType_TezosAddress": { + "(wire_out)": true + }, + "MessageType_TezosSignTx": { + "(wire_in)": true + }, + "MessageType_TezosSignedTx": { + "(wire_out)": true + }, + "MessageType_TezosGetPublicKey": { + "(wire_in)": true + }, + "MessageType_TezosPublicKey": { + "(wire_out)": true + }, + "MessageType_StellarSignTx": { + "(wire_in)": true + }, + "MessageType_StellarTxOpRequest": { + "(wire_out)": true + }, + "MessageType_StellarGetAddress": { + "(wire_in)": true + }, + "MessageType_StellarAddress": { + "(wire_out)": true + }, + "MessageType_StellarCreateAccountOp": { + "(wire_in)": true + }, + "MessageType_StellarPaymentOp": { + "(wire_in)": true + }, + "MessageType_StellarPathPaymentStrictReceiveOp": { + "(wire_in)": true + }, + "MessageType_StellarManageSellOfferOp": { + "(wire_in)": true + }, + "MessageType_StellarCreatePassiveSellOfferOp": { + "(wire_in)": true + }, + "MessageType_StellarSetOptionsOp": { + "(wire_in)": true + }, + "MessageType_StellarChangeTrustOp": { + "(wire_in)": true + }, + "MessageType_StellarAllowTrustOp": { + "(wire_in)": true + }, + "MessageType_StellarAccountMergeOp": { + "(wire_in)": true + }, + "MessageType_StellarManageDataOp": { + "(wire_in)": true + }, + "MessageType_StellarBumpSequenceOp": { + "(wire_in)": true + }, + "MessageType_StellarManageBuyOfferOp": { + "(wire_in)": true + }, + "MessageType_StellarPathPaymentStrictSendOp": { + "(wire_in)": true + }, + "MessageType_StellarSignedTx": { + "(wire_out)": true + }, + "MessageType_CardanoGetPublicKey": { + "(wire_in)": true + }, + "MessageType_CardanoPublicKey": { + "(wire_out)": true + }, + "MessageType_CardanoGetAddress": { + "(wire_in)": true + }, + "MessageType_CardanoAddress": { + "(wire_out)": true + }, + "MessageType_CardanoTxItemAck": { + "(wire_out)": true + }, + "MessageType_CardanoTxAuxiliaryDataSupplement": { + "(wire_out)": true + }, + "MessageType_CardanoTxWitnessRequest": { + "(wire_in)": true + }, + "MessageType_CardanoTxWitnessResponse": { + "(wire_out)": true + }, + "MessageType_CardanoTxHostAck": { + "(wire_in)": true + }, + "MessageType_CardanoTxBodyHash": { + "(wire_out)": true + }, + "MessageType_CardanoSignTxFinished": { + "(wire_out)": true + }, + "MessageType_CardanoSignTxInit": { + "(wire_in)": true + }, + "MessageType_CardanoTxInput": { + "(wire_in)": true + }, + "MessageType_CardanoTxOutput": { + "(wire_in)": true + }, + "MessageType_CardanoAssetGroup": { + "(wire_in)": true + }, + "MessageType_CardanoToken": { + "(wire_in)": true + }, + "MessageType_CardanoTxCertificate": { + "(wire_in)": true + }, + "MessageType_CardanoTxWithdrawal": { + "(wire_in)": true + }, + "MessageType_CardanoTxAuxiliaryData": { + "(wire_in)": true + }, + "MessageType_CardanoPoolOwner": { + "(wire_in)": true + }, + "MessageType_CardanoPoolRelayParameters": { + "(wire_in)": true + }, + "MessageType_CardanoGetNativeScriptHash": { + "(wire_in)": true + }, + "MessageType_CardanoNativeScriptHash": { + "(wire_out)": true + }, + "MessageType_CardanoTxMint": { + "(wire_in)": true + }, + "MessageType_CardanoTxCollateralInput": { + "(wire_in)": true + }, + "MessageType_CardanoTxRequiredSigner": { + "(wire_in)": true + }, + "MessageType_CardanoTxInlineDatumChunk": { + "(wire_in)": true + }, + "MessageType_CardanoTxReferenceScriptChunk": { + "(wire_in)": true + }, + "MessageType_CardanoTxReferenceInput": { + "(wire_in)": true + }, + "MessageType_RippleGetAddress": { + "(wire_in)": true + }, + "MessageType_RippleAddress": { + "(wire_out)": true + }, + "MessageType_RippleSignTx": { + "(wire_in)": true + }, + "MessageType_RippleSignedTx": { + "(wire_in)": true + }, + "MessageType_MoneroTransactionInitRequest": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionInitAck": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionSetInputRequest": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionSetInputAck": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionInputViniRequest": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionInputViniAck": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionAllInputsSetRequest": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionAllInputsSetAck": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionSetOutputRequest": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionSetOutputAck": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionAllOutSetRequest": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionAllOutSetAck": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionSignInputRequest": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionSignInputAck": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionFinalRequest": { + "(wire_out)": true + }, + "MessageType_MoneroTransactionFinalAck": { + "(wire_out)": true + }, + "MessageType_MoneroKeyImageExportInitRequest": { + "(wire_out)": true + }, + "MessageType_MoneroKeyImageExportInitAck": { + "(wire_out)": true + }, + "MessageType_MoneroKeyImageSyncStepRequest": { + "(wire_out)": true + }, + "MessageType_MoneroKeyImageSyncStepAck": { + "(wire_out)": true + }, + "MessageType_MoneroKeyImageSyncFinalRequest": { + "(wire_out)": true + }, + "MessageType_MoneroKeyImageSyncFinalAck": { + "(wire_out)": true + }, + "MessageType_MoneroGetAddress": { + "(wire_in)": true + }, + "MessageType_MoneroAddress": { + "(wire_out)": true + }, + "MessageType_MoneroGetWatchKey": { + "(wire_in)": true + }, + "MessageType_MoneroWatchKey": { + "(wire_out)": true + }, + "MessageType_DebugMoneroDiagRequest": { + "(wire_in)": true + }, + "MessageType_DebugMoneroDiagAck": { + "(wire_out)": true + }, + "MessageType_MoneroGetTxKeyRequest": { + "(wire_in)": true + }, + "MessageType_MoneroGetTxKeyAck": { + "(wire_out)": true + }, + "MessageType_MoneroLiveRefreshStartRequest": { + "(wire_in)": true + }, + "MessageType_MoneroLiveRefreshStartAck": { + "(wire_out)": true + }, + "MessageType_MoneroLiveRefreshStepRequest": { + "(wire_in)": true + }, + "MessageType_MoneroLiveRefreshStepAck": { + "(wire_out)": true + }, + "MessageType_MoneroLiveRefreshFinalRequest": { + "(wire_in)": true + }, + "MessageType_MoneroLiveRefreshFinalAck": { + "(wire_out)": true + }, + "MessageType_EosGetPublicKey": { + "(wire_in)": true + }, + "MessageType_EosPublicKey": { + "(wire_out)": true + }, + "MessageType_EosSignTx": { + "(wire_in)": true + }, + "MessageType_EosTxActionRequest": { + "(wire_out)": true + }, + "MessageType_EosTxActionAck": { + "(wire_in)": true + }, + "MessageType_EosSignedTx": { + "(wire_out)": true + }, + "MessageType_BinanceGetAddress": { + "(wire_in)": true + }, + "MessageType_BinanceAddress": { + "(wire_out)": true + }, + "MessageType_BinanceGetPublicKey": { + "(wire_in)": true + }, + "MessageType_BinancePublicKey": { + "(wire_out)": true + }, + "MessageType_BinanceSignTx": { + "(wire_in)": true + }, + "MessageType_BinanceTxRequest": { + "(wire_out)": true + }, + "MessageType_BinanceTransferMsg": { + "(wire_in)": true + }, + "MessageType_BinanceOrderMsg": { + "(wire_in)": true + }, + "MessageType_BinanceCancelMsg": { + "(wire_in)": true + }, + "MessageType_BinanceSignedTx": { + "(wire_out)": true + }, + "MessageType_WebAuthnListResidentCredentials": { + "(wire_in)": true + }, + "MessageType_WebAuthnCredentials": { + "(wire_out)": true + }, + "MessageType_WebAuthnAddResidentCredential": { + "(wire_in)": true + }, + "MessageType_WebAuthnRemoveResidentCredential": { + "(wire_in)": true + } + }, + "values": { + "MessageType_Initialize": 0, + "MessageType_Ping": 1, + "MessageType_Success": 2, + "MessageType_Failure": 3, + "MessageType_ChangePin": 4, + "MessageType_WipeDevice": 5, + "MessageType_GetEntropy": 9, + "MessageType_Entropy": 10, + "MessageType_LoadDevice": 13, + "MessageType_ResetDevice": 14, + "MessageType_SetBusy": 16, + "MessageType_Features": 17, + "MessageType_PinMatrixRequest": 18, + "MessageType_PinMatrixAck": 19, + "MessageType_Cancel": 20, + "MessageType_LockDevice": 24, + "MessageType_ApplySettings": 25, + "MessageType_ButtonRequest": 26, + "MessageType_ButtonAck": 27, + "MessageType_ApplyFlags": 28, + "MessageType_GetNonce": 31, + "MessageType_Nonce": 33, + "MessageType_BackupDevice": 34, + "MessageType_EntropyRequest": 35, + "MessageType_EntropyAck": 36, + "MessageType_PassphraseRequest": 41, + "MessageType_PassphraseAck": 42, + "MessageType_RecoveryDevice": 45, + "MessageType_WordRequest": 46, + "MessageType_WordAck": 47, + "MessageType_GetFeatures": 55, + "MessageType_SdProtect": 79, + "MessageType_ChangeWipeCode": 82, + "MessageType_EndSession": 83, + "MessageType_DoPreauthorized": 84, + "MessageType_PreauthorizedRequest": 85, + "MessageType_CancelAuthorization": 86, + "MessageType_RebootToBootloader": 87, + "MessageType_GetFirmwareHash": 88, + "MessageType_FirmwareHash": 89, + "MessageType_UnlockPath": 93, + "MessageType_UnlockedPathRequest": 94, + "MessageType_ShowDeviceTutorial": 95, + "MessageType_UnlockBootloader": 96, + "MessageType_AuthenticateDevice": 97, + "MessageType_AuthenticityProof": 98, + "MessageType_SetU2FCounter": 63, + "MessageType_GetNextU2FCounter": 80, + "MessageType_NextU2FCounter": 81, + "MessageType_Deprecated_PassphraseStateRequest": 77, + "MessageType_Deprecated_PassphraseStateAck": 78, + "MessageType_FirmwareErase": 6, + "MessageType_FirmwareUpload": 7, + "MessageType_FirmwareRequest": 8, + "MessageType_SelfTest": 32, + "MessageType_GetPublicKey": 11, + "MessageType_PublicKey": 12, + "MessageType_SignTx": 15, + "MessageType_TxRequest": 21, + "MessageType_TxAck": 22, + "MessageType_GetAddress": 29, + "MessageType_Address": 30, + "MessageType_TxAckPaymentRequest": 37, + "MessageType_SignMessage": 38, + "MessageType_VerifyMessage": 39, + "MessageType_MessageSignature": 40, + "MessageType_GetOwnershipId": 43, + "MessageType_OwnershipId": 44, + "MessageType_GetOwnershipProof": 49, + "MessageType_OwnershipProof": 50, + "MessageType_AuthorizeCoinJoin": 51, + "MessageType_CipherKeyValue": 23, + "MessageType_CipheredKeyValue": 48, + "MessageType_SignIdentity": 53, + "MessageType_SignedIdentity": 54, + "MessageType_GetECDHSessionKey": 61, + "MessageType_ECDHSessionKey": 62, + "MessageType_CosiCommit": 71, + "MessageType_CosiCommitment": 72, + "MessageType_CosiSign": 73, + "MessageType_CosiSignature": 74, + "MessageType_DebugLinkDecision": 100, + "MessageType_DebugLinkGetState": 101, + "MessageType_DebugLinkState": 102, + "MessageType_DebugLinkStop": 103, + "MessageType_DebugLinkLog": 104, + "MessageType_DebugLinkMemoryRead": 110, + "MessageType_DebugLinkMemory": 111, + "MessageType_DebugLinkMemoryWrite": 112, + "MessageType_DebugLinkFlashErase": 113, + "MessageType_DebugLinkLayout": 9001, + "MessageType_DebugLinkReseedRandom": 9002, + "MessageType_DebugLinkRecordScreen": 9003, + "MessageType_DebugLinkEraseSdCard": 9005, + "MessageType_DebugLinkWatchLayout": 9006, + "MessageType_DebugLinkResetDebugEvents": 9007, + "MessageType_EthereumGetPublicKey": 450, + "MessageType_EthereumPublicKey": 451, + "MessageType_EthereumGetAddress": 56, + "MessageType_EthereumAddress": 57, + "MessageType_EthereumSignTx": 58, + "MessageType_EthereumSignTxEIP1559": 452, + "MessageType_EthereumTxRequest": 59, + "MessageType_EthereumTxAck": 60, + "MessageType_EthereumSignMessage": 64, + "MessageType_EthereumVerifyMessage": 65, + "MessageType_EthereumMessageSignature": 66, + "MessageType_EthereumSignTypedData": 464, + "MessageType_EthereumTypedDataStructRequest": 465, + "MessageType_EthereumTypedDataStructAck": 466, + "MessageType_EthereumTypedDataValueRequest": 467, + "MessageType_EthereumTypedDataValueAck": 468, + "MessageType_EthereumTypedDataSignature": 469, + "MessageType_EthereumSignTypedHash": 470, + "MessageType_NEMGetAddress": 67, + "MessageType_NEMAddress": 68, + "MessageType_NEMSignTx": 69, + "MessageType_NEMSignedTx": 70, + "MessageType_NEMDecryptMessage": 75, + "MessageType_NEMDecryptedMessage": 76, + "MessageType_TezosGetAddress": 150, + "MessageType_TezosAddress": 151, + "MessageType_TezosSignTx": 152, + "MessageType_TezosSignedTx": 153, + "MessageType_TezosGetPublicKey": 154, + "MessageType_TezosPublicKey": 155, + "MessageType_StellarSignTx": 202, + "MessageType_StellarTxOpRequest": 203, + "MessageType_StellarGetAddress": 207, + "MessageType_StellarAddress": 208, + "MessageType_StellarCreateAccountOp": 210, + "MessageType_StellarPaymentOp": 211, + "MessageType_StellarPathPaymentStrictReceiveOp": 212, + "MessageType_StellarManageSellOfferOp": 213, + "MessageType_StellarCreatePassiveSellOfferOp": 214, + "MessageType_StellarSetOptionsOp": 215, + "MessageType_StellarChangeTrustOp": 216, + "MessageType_StellarAllowTrustOp": 217, + "MessageType_StellarAccountMergeOp": 218, + "MessageType_StellarManageDataOp": 220, + "MessageType_StellarBumpSequenceOp": 221, + "MessageType_StellarManageBuyOfferOp": 222, + "MessageType_StellarPathPaymentStrictSendOp": 223, + "MessageType_StellarSignedTx": 230, + "MessageType_CardanoGetPublicKey": 305, + "MessageType_CardanoPublicKey": 306, + "MessageType_CardanoGetAddress": 307, + "MessageType_CardanoAddress": 308, + "MessageType_CardanoTxItemAck": 313, + "MessageType_CardanoTxAuxiliaryDataSupplement": 314, + "MessageType_CardanoTxWitnessRequest": 315, + "MessageType_CardanoTxWitnessResponse": 316, + "MessageType_CardanoTxHostAck": 317, + "MessageType_CardanoTxBodyHash": 318, + "MessageType_CardanoSignTxFinished": 319, + "MessageType_CardanoSignTxInit": 320, + "MessageType_CardanoTxInput": 321, + "MessageType_CardanoTxOutput": 322, + "MessageType_CardanoAssetGroup": 323, + "MessageType_CardanoToken": 324, + "MessageType_CardanoTxCertificate": 325, + "MessageType_CardanoTxWithdrawal": 326, + "MessageType_CardanoTxAuxiliaryData": 327, + "MessageType_CardanoPoolOwner": 328, + "MessageType_CardanoPoolRelayParameters": 329, + "MessageType_CardanoGetNativeScriptHash": 330, + "MessageType_CardanoNativeScriptHash": 331, + "MessageType_CardanoTxMint": 332, + "MessageType_CardanoTxCollateralInput": 333, + "MessageType_CardanoTxRequiredSigner": 334, + "MessageType_CardanoTxInlineDatumChunk": 335, + "MessageType_CardanoTxReferenceScriptChunk": 336, + "MessageType_CardanoTxReferenceInput": 337, + "MessageType_RippleGetAddress": 400, + "MessageType_RippleAddress": 401, + "MessageType_RippleSignTx": 402, + "MessageType_RippleSignedTx": 403, + "MessageType_MoneroTransactionInitRequest": 501, + "MessageType_MoneroTransactionInitAck": 502, + "MessageType_MoneroTransactionSetInputRequest": 503, + "MessageType_MoneroTransactionSetInputAck": 504, + "MessageType_MoneroTransactionInputViniRequest": 507, + "MessageType_MoneroTransactionInputViniAck": 508, + "MessageType_MoneroTransactionAllInputsSetRequest": 509, + "MessageType_MoneroTransactionAllInputsSetAck": 510, + "MessageType_MoneroTransactionSetOutputRequest": 511, + "MessageType_MoneroTransactionSetOutputAck": 512, + "MessageType_MoneroTransactionAllOutSetRequest": 513, + "MessageType_MoneroTransactionAllOutSetAck": 514, + "MessageType_MoneroTransactionSignInputRequest": 515, + "MessageType_MoneroTransactionSignInputAck": 516, + "MessageType_MoneroTransactionFinalRequest": 517, + "MessageType_MoneroTransactionFinalAck": 518, + "MessageType_MoneroKeyImageExportInitRequest": 530, + "MessageType_MoneroKeyImageExportInitAck": 531, + "MessageType_MoneroKeyImageSyncStepRequest": 532, + "MessageType_MoneroKeyImageSyncStepAck": 533, + "MessageType_MoneroKeyImageSyncFinalRequest": 534, + "MessageType_MoneroKeyImageSyncFinalAck": 535, + "MessageType_MoneroGetAddress": 540, + "MessageType_MoneroAddress": 541, + "MessageType_MoneroGetWatchKey": 542, + "MessageType_MoneroWatchKey": 543, + "MessageType_DebugMoneroDiagRequest": 546, + "MessageType_DebugMoneroDiagAck": 547, + "MessageType_MoneroGetTxKeyRequest": 550, + "MessageType_MoneroGetTxKeyAck": 551, + "MessageType_MoneroLiveRefreshStartRequest": 552, + "MessageType_MoneroLiveRefreshStartAck": 553, + "MessageType_MoneroLiveRefreshStepRequest": 554, + "MessageType_MoneroLiveRefreshStepAck": 555, + "MessageType_MoneroLiveRefreshFinalRequest": 556, + "MessageType_MoneroLiveRefreshFinalAck": 557, + "MessageType_EosGetPublicKey": 600, + "MessageType_EosPublicKey": 601, + "MessageType_EosSignTx": 602, + "MessageType_EosTxActionRequest": 603, + "MessageType_EosTxActionAck": 604, + "MessageType_EosSignedTx": 605, + "MessageType_BinanceGetAddress": 700, + "MessageType_BinanceAddress": 701, + "MessageType_BinanceGetPublicKey": 702, + "MessageType_BinancePublicKey": 703, + "MessageType_BinanceSignTx": 704, + "MessageType_BinanceTxRequest": 705, + "MessageType_BinanceTransferMsg": 706, + "MessageType_BinanceOrderMsg": 707, + "MessageType_BinanceCancelMsg": 708, + "MessageType_BinanceSignedTx": 709, + "MessageType_WebAuthnListResidentCredentials": 800, + "MessageType_WebAuthnCredentials": 801, + "MessageType_WebAuthnAddResidentCredential": 802, + "MessageType_WebAuthnRemoveResidentCredential": 803 + } + }, + "RippleGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "RippleAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "RippleSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "flags": { + "type": "uint32", + "id": 3, + "options": { + "default": 0 + } + }, + "sequence": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "last_ledger_sequence": { + "type": "uint32", + "id": 5 + }, + "payment": { + "rule": "required", + "type": "RipplePayment", + "id": 6 + } + }, + "nested": { + "RipplePayment": { + "fields": { + "amount": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "destination": { + "rule": "required", + "type": "string", + "id": 2 + }, + "destination_tag": { + "type": "uint32", + "id": 3 + } + } + } + } + }, + "RippleSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "serialized_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "StellarAssetType": { + "values": { + "NATIVE": 0, + "ALPHANUM4": 1, + "ALPHANUM12": 2 + } + }, + "StellarAsset": { + "fields": { + "type": { + "rule": "required", + "type": "StellarAssetType", + "id": 1 + }, + "code": { + "type": "string", + "id": 2 + }, + "issuer": { + "type": "string", + "id": 3 + } + } + }, + "StellarGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "StellarAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "StellarSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "network_passphrase": { + "rule": "required", + "type": "string", + "id": 3 + }, + "source_account": { + "rule": "required", + "type": "string", + "id": 4 + }, + "fee": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "sequence_number": { + "rule": "required", + "type": "uint64", + "id": 6 + }, + "timebounds_start": { + "rule": "required", + "type": "uint32", + "id": 8 + }, + "timebounds_end": { + "rule": "required", + "type": "uint32", + "id": 9 + }, + "memo_type": { + "rule": "required", + "type": "StellarMemoType", + "id": 10 + }, + "memo_text": { + "type": "string", + "id": 11 + }, + "memo_id": { + "type": "uint64", + "id": 12 + }, + "memo_hash": { + "type": "bytes", + "id": 13 + }, + "num_operations": { + "rule": "required", + "type": "uint32", + "id": 14 + } + }, + "nested": { + "StellarMemoType": { + "values": { + "NONE": 0, + "TEXT": 1, + "ID": 2, + "HASH": 3, + "RETURN": 4 + } + } + } + }, + "StellarTxOpRequest": { + "fields": {} + }, + "StellarPaymentOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "destination_account": { + "rule": "required", + "type": "string", + "id": 2 + }, + "asset": { + "rule": "required", + "type": "StellarAsset", + "id": 3 + }, + "amount": { + "rule": "required", + "type": "sint64", + "id": 4 + } + } + }, + "StellarCreateAccountOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "new_account": { + "rule": "required", + "type": "string", + "id": 2 + }, + "starting_balance": { + "rule": "required", + "type": "sint64", + "id": 3 + } + } + }, + "StellarPathPaymentStrictReceiveOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "send_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "send_max": { + "rule": "required", + "type": "sint64", + "id": 3 + }, + "destination_account": { + "rule": "required", + "type": "string", + "id": 4 + }, + "destination_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 5 + }, + "destination_amount": { + "rule": "required", + "type": "sint64", + "id": 6 + }, + "paths": { + "rule": "repeated", + "type": "StellarAsset", + "id": 7 + } + } + }, + "StellarPathPaymentStrictSendOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "send_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "send_amount": { + "rule": "required", + "type": "sint64", + "id": 3 + }, + "destination_account": { + "rule": "required", + "type": "string", + "id": 4 + }, + "destination_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 5 + }, + "destination_min": { + "rule": "required", + "type": "sint64", + "id": 6 + }, + "paths": { + "rule": "repeated", + "type": "StellarAsset", + "id": 7 + } + } + }, + "StellarManageSellOfferOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "selling_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "buying_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 3 + }, + "amount": { + "rule": "required", + "type": "sint64", + "id": 4 + }, + "price_n": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "price_d": { + "rule": "required", + "type": "uint32", + "id": 6 + }, + "offer_id": { + "rule": "required", + "type": "uint64", + "id": 7 + } + } + }, + "StellarManageBuyOfferOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "selling_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "buying_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 3 + }, + "amount": { + "rule": "required", + "type": "sint64", + "id": 4 + }, + "price_n": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "price_d": { + "rule": "required", + "type": "uint32", + "id": 6 + }, + "offer_id": { + "rule": "required", + "type": "uint64", + "id": 7 + } + } + }, + "StellarCreatePassiveSellOfferOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "selling_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "buying_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 3 + }, + "amount": { + "rule": "required", + "type": "sint64", + "id": 4 + }, + "price_n": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "price_d": { + "rule": "required", + "type": "uint32", + "id": 6 + } + } + }, + "StellarSetOptionsOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "inflation_destination_account": { + "type": "string", + "id": 2 + }, + "clear_flags": { + "type": "uint32", + "id": 3 + }, + "set_flags": { + "type": "uint32", + "id": 4 + }, + "master_weight": { + "type": "uint32", + "id": 5 + }, + "low_threshold": { + "type": "uint32", + "id": 6 + }, + "medium_threshold": { + "type": "uint32", + "id": 7 + }, + "high_threshold": { + "type": "uint32", + "id": 8 + }, + "home_domain": { + "type": "string", + "id": 9 + }, + "signer_type": { + "type": "StellarSignerType", + "id": 10 + }, + "signer_key": { + "type": "bytes", + "id": 11 + }, + "signer_weight": { + "type": "uint32", + "id": 12 + } + }, + "nested": { + "StellarSignerType": { + "values": { + "ACCOUNT": 0, + "PRE_AUTH": 1, + "HASH": 2 + } + } + } + }, + "StellarChangeTrustOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "limit": { + "rule": "required", + "type": "uint64", + "id": 3 + } + } + }, + "StellarAllowTrustOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "trusted_account": { + "rule": "required", + "type": "string", + "id": 2 + }, + "asset_type": { + "rule": "required", + "type": "StellarAssetType", + "id": 3 + }, + "asset_code": { + "type": "string", + "id": 4 + }, + "is_authorized": { + "rule": "required", + "type": "bool", + "id": 5 + } + } + }, + "StellarAccountMergeOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "destination_account": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "StellarManageDataOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "key": { + "rule": "required", + "type": "string", + "id": 2 + }, + "value": { + "type": "bytes", + "id": 3 + } + } + }, + "StellarBumpSequenceOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "bump_to": { + "rule": "required", + "type": "uint64", + "id": 2 + } + } + }, + "StellarSignedTx": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "TezosGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "TezosAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "TezosGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "TezosPublicKey": { + "fields": { + "public_key": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "TezosSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "branch": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "reveal": { + "type": "TezosRevealOp", + "id": 3 + }, + "transaction": { + "type": "TezosTransactionOp", + "id": 4 + }, + "origination": { + "type": "TezosOriginationOp", + "id": 5 + }, + "delegation": { + "type": "TezosDelegationOp", + "id": 6 + }, + "proposal": { + "type": "TezosProposalOp", + "id": 7 + }, + "ballot": { + "type": "TezosBallotOp", + "id": 8 + } + }, + "nested": { + "TezosContractID": { + "fields": { + "tag": { + "rule": "required", + "type": "TezosContractType", + "id": 1 + }, + "hash": { + "rule": "required", + "type": "bytes", + "id": 2 + } + }, + "nested": { + "TezosContractType": { + "values": { + "Implicit": 0, + "Originated": 1 + } + } + } + }, + "TezosRevealOp": { + "fields": { + "source": { + "rule": "required", + "type": "bytes", + "id": 7 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "counter": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "storage_limit": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 6 + } + } + }, + "TezosTransactionOp": { + "fields": { + "source": { + "rule": "required", + "type": "bytes", + "id": 9 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "counter": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "storage_limit": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 6 + }, + "destination": { + "rule": "required", + "type": "TezosContractID", + "id": 7 + }, + "parameters": { + "type": "bytes", + "id": 8 + }, + "parameters_manager": { + "type": "TezosParametersManager", + "id": 10 + } + }, + "nested": { + "TezosParametersManager": { + "fields": { + "set_delegate": { + "type": "bytes", + "id": 1 + }, + "cancel_delegate": { + "type": "bool", + "id": 2 + }, + "transfer": { + "type": "TezosManagerTransfer", + "id": 3 + } + }, + "nested": { + "TezosManagerTransfer": { + "fields": { + "destination": { + "rule": "required", + "type": "TezosContractID", + "id": 1 + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 2 + } + } + } + } + } + } + }, + "TezosOriginationOp": { + "fields": { + "source": { + "rule": "required", + "type": "bytes", + "id": 12 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "counter": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "storage_limit": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "manager_pubkey": { + "type": "bytes", + "id": 6 + }, + "balance": { + "rule": "required", + "type": "uint64", + "id": 7 + }, + "spendable": { + "type": "bool", + "id": 8 + }, + "delegatable": { + "type": "bool", + "id": 9 + }, + "delegate": { + "type": "bytes", + "id": 10 + }, + "script": { + "rule": "required", + "type": "bytes", + "id": 11 + } + } + }, + "TezosDelegationOp": { + "fields": { + "source": { + "rule": "required", + "type": "bytes", + "id": 7 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "counter": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "storage_limit": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "delegate": { + "rule": "required", + "type": "bytes", + "id": 6 + } + } + }, + "TezosProposalOp": { + "fields": { + "source": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "period": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "proposals": { + "rule": "repeated", + "type": "bytes", + "id": 4 + } + } + }, + "TezosBallotOp": { + "fields": { + "source": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "period": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "proposal": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "ballot": { + "rule": "required", + "type": "TezosBallotType", + "id": 4 + } + }, + "nested": { + "TezosBallotType": { + "values": { + "Yay": 0, + "Nay": 1, + "Pass": 2 + } + } + } + } + } + }, + "TezosSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "string", + "id": 1 + }, + "sig_op_contents": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "operation_hash": { + "rule": "required", + "type": "string", + "id": 3 + } + } + }, + "WebAuthnListResidentCredentials": { + "fields": {} + }, + "WebAuthnAddResidentCredential": { + "fields": { + "credential_id": { + "type": "bytes", + "id": 1 + } + } + }, + "WebAuthnRemoveResidentCredential": { + "fields": { + "index": { + "type": "uint32", + "id": 1 + } + } + }, + "WebAuthnCredentials": { + "fields": { + "credentials": { + "rule": "repeated", + "type": "WebAuthnCredential", + "id": 1 + } + }, + "nested": { + "WebAuthnCredential": { + "fields": { + "index": { + "type": "uint32", + "id": 1 + }, + "id": { + "type": "bytes", + "id": 2 + }, + "rp_id": { + "type": "string", + "id": 3 + }, + "rp_name": { + "type": "string", + "id": 4 + }, + "user_id": { + "type": "bytes", + "id": 5 + }, + "user_name": { + "type": "string", + "id": 6 + }, + "user_display_name": { + "type": "string", + "id": 7 + }, + "creation_time": { + "type": "uint32", + "id": 8 + }, + "hmac_secret": { + "type": "bool", + "id": 9 + }, + "use_sign_count": { + "type": "bool", + "id": 10 + }, + "algorithm": { + "type": "sint32", + "id": 11 + }, + "curve": { + "type": "sint32", + "id": 12 + } + } + } + } + }, + "google": { + "nested": { + "protobuf": { + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "public_dependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weak_dependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "message_type": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enum_type": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "source_code_info": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nested_type": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enum_type": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extension_range": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneof_decl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reserved_range": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reserved_name": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "type_name": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "default_value": { + "type": "string", + "id": 7 + }, + "oneof_index": { + "type": "int32", + "id": 9 + }, + "json_name": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "input_type": { + "type": "string", + "id": 2 + }, + "output_type": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "client_streaming": { + "type": "bool", + "id": 5 + }, + "server_streaming": { + "type": "bool", + "id": 6 + } + } + }, + "FileOptions": { + "fields": { + "java_package": { + "type": "string", + "id": 1 + }, + "java_outer_classname": { + "type": "string", + "id": 8 + }, + "java_multiple_files": { + "type": "bool", + "id": 10 + }, + "java_generate_equals_and_hash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "java_string_check_utf8": { + "type": "bool", + "id": 27 + }, + "optimize_for": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "go_package": { + "type": "string", + "id": 11 + }, + "cc_generic_services": { + "type": "bool", + "id": 16 + }, + "java_generic_services": { + "type": "bool", + "id": 17 + }, + "py_generic_services": { + "type": "bool", + "id": 18 + }, + "deprecated": { + "type": "bool", + "id": 23 + }, + "cc_enable_arenas": { + "type": "bool", + "id": 31 + }, + "objc_class_prefix": { + "type": "string", + "id": 36 + }, + "csharp_namespace": { + "type": "string", + "id": 37 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]], + "reserved": [[38, 38]], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "message_set_wire_format": { + "type": "bool", + "id": 1 + }, + "no_standard_descriptor_accessor": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "map_entry": { + "type": "bool", + "id": 7 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]], + "reserved": [[8, 8]] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "weak": { + "type": "bool", + "id": 10 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]], + "reserved": [[4, 4]], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]] + }, + "EnumOptions": { + "fields": { + "allow_alias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]] + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifier_value": { + "type": "string", + "id": 3 + }, + "positive_int_value": { + "type": "uint64", + "id": 4 + }, + "negative_int_value": { + "type": "int64", + "id": 5 + }, + "double_value": { + "type": "double", + "id": 6 + }, + "string_value": { + "type": "bytes", + "id": 7 + }, + "aggregate_value": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "name_part": { + "rule": "required", + "type": "string", + "id": 1 + }, + "is_extension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leading_comments": { + "type": "string", + "id": 3 + }, + "trailing_comments": { + "type": "string", + "id": 4 + }, + "leading_detached_comments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "source_file": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + } + } + } + } + } + } +} diff --git a/app/trezor-prebuild/build/iframe.html b/app/trezor-prebuild/build/iframe.html new file mode 100644 index 0000000000..db37206426 --- /dev/null +++ b/app/trezor-prebuild/build/iframe.html @@ -0,0 +1,33 @@ + + + + + + + TrezorConnect | Trezor + + + + + + + + + + + + diff --git a/app/trezor-prebuild/build/js/iframe.c555a3cb25e8d46878cf.js b/app/trezor-prebuild/build/js/iframe.c555a3cb25e8d46878cf.js new file mode 100644 index 0000000000..edd1e0ea1a --- /dev/null +++ b/app/trezor-prebuild/build/js/iframe.c555a3cb25e8d46878cf.js @@ -0,0 +1,59 @@ +(()=>{var __webpack_modules__={"../../node_modules/@noble/hashes/_assert.js":(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function i(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function n(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function o(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e,t){n(e);const r=t.outputLen;if(e.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const i=r("../../node_modules/@noble/hashes/_assert.js"),n=r("../../node_modules/@noble/hashes/utils.js");class s extends n.Hash{constructor(e,t,r,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,n.createView)(this.buffer)}update(e){i.default.exists(this);const{view:t,buffer:r,blockLen:s}=this,o=(e=(0,n.toBytes)(e)).length;for(let i=0;is-a&&(this.process(r,0),a=0);for(let e=a;e>n&s),a=Number(r&s),u=i?4:0,h=i?0:4;e.setUint32(t+u,o,i),e.setUint32(t+h,a,i)}(r,s-8,BigInt(8*this.length),o),this.process(r,0);const u=(0,n.createView)(e),h=this.outputLen;if(h%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=h/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},"../../node_modules/@noble/hashes/sha256.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const i=r("../../node_modules/@noble/hashes/_sha2.js"),n=r("../../node_modules/@noble/hashes/utils.js"),s=(e,t,r)=>e&t^e&r^t&r,o=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class h extends i.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:i,E:n,F:s,G:o,H:a}=this;return[e,t,r,i,n,s,o,a]}set(e,t,r,i,n,s,o,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|s,this.G=0|o,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],r=u[e-2],i=(0,n.rotr)(t,7)^(0,n.rotr)(t,18)^t>>>3,s=(0,n.rotr)(r,17)^(0,n.rotr)(r,19)^r>>>10;u[e]=s+u[e-7]+i+u[e-16]|0}let{A:r,B:i,C:a,D:h,E:l,F:d,G:c,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,n.rotr)(l,6)^(0,n.rotr)(l,11)^(0,n.rotr)(l,25))+((p=l)&d^~p&c)+o[e]+u[e]|0,m=((0,n.rotr)(r,2)^(0,n.rotr)(r,13)^(0,n.rotr)(r,22))+s(r,i,a)|0;f=c,c=d,d=l,l=h+t|0,h=a,a=i,i=r,r=t+m|0}var p;r=r+this.A|0,i=i+this.B|0,a=a+this.C|0,h=h+this.D|0,l=l+this.E|0,d=d+this.F|0,c=c+this.G|0,f=f+this.H|0,this.set(r,i,a,h,l,d,c,f)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class l extends h{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,n.wrapConstructor)((()=>new h)),t.sha224=(0,n.wrapConstructor)((()=>new l))},"../../node_modules/@noble/hashes/utils.js":(e,t,r)=>{"use strict"; +/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const i=r("../../node_modules/@noble/hashes/crypto.js");t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const n=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r{},t.asyncLoop=async function(e,r,i){let n=Date.now();for(let s=0;s=0&&ee instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,i=0;te().update(o(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(o(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(i.crypto&&"function"==typeof i.crypto.getRandomValues)return i.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},"../../node_modules/@protobufjs/aspromise/index.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;e.exports=function(e,t){var r=new Array(arguments.length-1),n=0,s=2,o=!0;for(;s{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var i=new Array(64),n=new Array(123),s=0;s<64;)n[i[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;r.encode=function(e,t,r){for(var n,s=null,o=[],a=0,u=0;t>2],n=(3&h)<<4,u=1;break;case 1:o[a++]=i[n|h>>4],n=(15&h)<<2,u=2;break;case 2:o[a++]=i[n|h>>6],o[a++]=i[63&h],u=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return u&&(o[a++]=i[n],o[a++]=61,1===u&&(o[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};var o="invalid encoding";r.decode=function(e,t,r){for(var i,s=r,a=0,u=0;u1)break;if(void 0===(h=n[h]))throw Error(o);switch(a){case 0:i=h,a=1;break;case 1:t[r++]=i<<2|(48&h)>>4,i=h,a=2;break;case 2:t[r++]=(15&i)<<4|(60&h)>>2,i=h,a=3;break;case 3:t[r++]=(3&i)<<6|h,a=0}}if(1===a)throw Error(o);return r-s},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},"../../node_modules/@protobufjs/codegen/index.js":e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var i=[];function n(e){if("string"!=typeof e){var r=s();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var o=Object.keys(e),a=new Array(o.length+1),u=new Array(o.length),h=0;h{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],i=0;i{"use strict";e.exports=s;var i=r("../../node_modules/@protobufjs/aspromise/index.js"),n=r("../../node_modules/@protobufjs/inquire/index.js")("fs");function s(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&n&&n.readFile?n.readFile(e,(function(i,n){return i&&"undefined"!=typeof XMLHttpRequest?s.xhr(e,t,r):i?r(i):r(null,t.binary?n:n.toString("utf8"))})):s.xhr(e,t,r):i(s,this,e,t)}s.xhr=function(e,t,r){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(0!==i.status&&200!==i.status)return r(Error("status "+i.status));if(t.binary){var e=i.response;if(!e){e=[];for(var n=0;n{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),i=128===r[3];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3]}function s(e,i,n){t[0]=e,i[n]=r[3],i[n+1]=r[2],i[n+2]=r[1],i[n+3]=r[0]}function o(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],t[0]}function a(e,i){return r[3]=e[i],r[2]=e[i+1],r[1]=e[i+2],r[0]=e[i+3],t[0]}e.writeFloatLE=i?n:s,e.writeFloatBE=i?s:n,e.readFloatLE=i?o:a,e.readFloatBE=i?a:o}():function(){function t(e,t,r,i){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,i);else if(isNaN(t))e(2143289344,r,i);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,i);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,i);else{var s=Math.floor(Math.log(t)/Math.LN2);e((n<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,r,i)}}function o(e,t,r){var i=e(t,r),n=2*(i>>31)+1,s=i>>>23&255,o=8388607&i;return 255===s?o?NaN:n*(1/0):0===s?1401298464324817e-60*n*o:n*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i),e.readFloatLE=o.bind(null,n),e.readFloatBE=o.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),i=128===r[7];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3],i[n+4]=r[4],i[n+5]=r[5],i[n+6]=r[6],i[n+7]=r[7]}function s(e,i,n){t[0]=e,i[n]=r[7],i[n+1]=r[6],i[n+2]=r[5],i[n+3]=r[4],i[n+4]=r[3],i[n+5]=r[2],i[n+6]=r[1],i[n+7]=r[0]}function o(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],r[4]=e[i+4],r[5]=e[i+5],r[6]=e[i+6],r[7]=e[i+7],t[0]}function a(e,i){return r[7]=e[i],r[6]=e[i+1],r[5]=e[i+2],r[4]=e[i+3],r[3]=e[i+4],r[2]=e[i+5],r[1]=e[i+6],r[0]=e[i+7],t[0]}e.writeDoubleLE=i?n:s,e.writeDoubleBE=i?s:n,e.readDoubleLE=i?o:a,e.readDoubleBE=i?a:o}():function(){function t(e,t,r,i,n,s){var o=i<0?1:0;if(o&&(i=-i),0===i)e(0,n,s+t),e(1/i>0?0:2147483648,n,s+r);else if(isNaN(i))e(0,n,s+t),e(2146959360,n,s+r);else if(i>17976931348623157e292)e(0,n,s+t),e((o<<31|2146435072)>>>0,n,s+r);else{var a;if(i<22250738585072014e-324)e((a=i/5e-324)>>>0,n,s+t),e((o<<31|a/4294967296)>>>0,n,s+r);else{var u=Math.floor(Math.log(i)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=i*Math.pow(2,-u))>>>0,n,s+t),e((o<<31|u+1023<<20|1048576*a&1048575)>>>0,n,s+r)}}}function o(e,t,r,i,n){var s=e(i,n+t),o=e(i,n+r),a=2*(o>>31)+1,u=o>>>20&2047,h=4294967296*(1048575&o)+s;return 2047===u?h?NaN:a*(1/0):0===u?5e-324*a*h:a*Math.pow(2,u-1075)*(h+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0),e.readDoubleLE=o.bind(null,n,0,4),e.readDoubleBE=o.bind(null,s,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function i(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},"../../node_modules/@protobufjs/inquire/index.js":module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},"../../node_modules/@protobufjs/path/index.js":(e,t)=>{"use strict";var r=t,i=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=i(e),n="";r&&(n=t.shift()+"/");for(var s=0;s0&&".."!==t[s-1]?t.splice(--s,2):r?t.splice(s,1):++s:"."===t[s]?t.splice(s,1):++s;return n+t.join("/")};r.resolve=function(e,t,r){return r||(t=n(t)),i(t)?t:(r||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}},"../../node_modules/@protobufjs/pool/index.js":e=>{"use strict";e.exports=function(e,t,r){var i=r||8192,n=i>>>1,s=null,o=i;return function(r){if(r<1||r>n)return e(r);o+r>i&&(s=e(i),o=0);var a=t.call(s,o,o+=r);return 7&o&&(o=1+(7|o)),a}}},"../../node_modules/@protobufjs/utf8/index.js":(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,i=0;i191&&i<224?s[o++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[o++]=55296+(i>>10),s[o++]=56320+(1023&i)):s[o++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,s)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,s.slice(0,o))),n.join("")):String.fromCharCode.apply(String,s.slice(0,o))},r.write=function(e,t,r){for(var i,n,s=r,o=0;o>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(o+1)))?(i=65536+((1023&i)<<10)+(1023&n),++o,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-s}},"../../node_modules/asn1.js/lib/asn1.js":(e,t,r)=>{"use strict";const i=t;i.bignum=r("../../node_modules/asn1.js/node_modules/bn.js/lib/bn.js"),i.define=r("../../node_modules/asn1.js/lib/asn1/api.js").define,i.base=r("../../node_modules/asn1.js/lib/asn1/base/index.js"),i.constants=r("../../node_modules/asn1.js/lib/asn1/constants/index.js"),i.decoders=r("../../node_modules/asn1.js/lib/asn1/decoders/index.js"),i.encoders=r("../../node_modules/asn1.js/lib/asn1/encoders/index.js")},"../../node_modules/asn1.js/lib/asn1/api.js":(e,t,r)=>{"use strict";const i=r("../../node_modules/asn1.js/lib/asn1/encoders/index.js"),n=r("../../node_modules/asn1.js/lib/asn1/decoders/index.js"),s=r("../../node_modules/inherits/inherits_browser.js");function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new o(e,t)},o.prototype._createNamed=function(e){const t=this.name;function r(e){this._initNamed(e,t)}return s(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},o.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n[e])),this.decoders[e]},o.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},o.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(i[e])),this.encoders[e]},o.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},"../../node_modules/asn1.js/lib/asn1/base/buffer.js":(e,t,r)=>{"use strict";const i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/asn1.js/lib/asn1/base/reporter.js").b,Buffer=r("../../node_modules/safer-buffer/safer.js").Buffer;function s(e,t){n.call(this,t),Buffer.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function o(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return o.isEncoderBuffer(e)||(e=new o(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=Buffer.byteLength(e);else{if(!Buffer.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}i(s,n),t.C=s,s.isDecoderBuffer=function(e){if(e instanceof s)return!0;return"object"==typeof e&&Buffer.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},s.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},s.prototype.restore=function(e){const t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,n.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},s.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.R=o,o.isEncoderBuffer=function(e){if(e instanceof o)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},o.prototype.join=function(e,t){return e||(e=Buffer.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(e,t),t+=r.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):Buffer.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},"../../node_modules/asn1.js/lib/asn1/base/index.js":(e,t,r)=>{"use strict";const i=t;i.Reporter=r("../../node_modules/asn1.js/lib/asn1/base/reporter.js").b,i.DecoderBuffer=r("../../node_modules/asn1.js/lib/asn1/base/buffer.js").C,i.EncoderBuffer=r("../../node_modules/asn1.js/lib/asn1/base/buffer.js").R,i.Node=r("../../node_modules/asn1.js/lib/asn1/base/node.js")},"../../node_modules/asn1.js/lib/asn1/base/node.js":(e,t,r)=>{"use strict";const i=r("../../node_modules/asn1.js/lib/asn1/base/reporter.js").b,n=r("../../node_modules/asn1.js/lib/asn1/base/buffer.js").R,s=r("../../node_modules/asn1.js/lib/asn1/base/buffer.js").C,o=r("../../node_modules/minimalistic-assert/index.js"),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function h(e,t,r){const i={};this._baseState=i,i.name=r,i.enc=e,i.parent=t||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}e.exports=h;const l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];h.prototype.clone=function(){const e=this._baseState,t={};l.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);return r._baseState=t,r},h.prototype._wrap=function(){const e=this._baseState;u.forEach((function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},h.prototype._init=function(e){const t=this._baseState;o(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),o.equal(t.children.length,1,"Root node can have only one child")},h.prototype._useArgs=function(e){const t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(o(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(o(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(r){r==(0|r)&&(r|=0);const i=e[r];t[i]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){h.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),a.forEach((function(e){h.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return o(null===t.tag),t.tag=e,this._useArgs(r),this}})),h.prototype.use=function(e){o(e);const t=this._baseState;return o(null===t.use),t.use=e,this},h.prototype.optional=function(){return this._baseState.optional=!0,this},h.prototype.def=function(e){const t=this._baseState;return o(null===t.default),t.default=e,t.optional=!0,this},h.prototype.explicit=function(e){const t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.explicit=e,this},h.prototype.implicit=function(e){const t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.implicit=e,this},h.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},h.prototype.key=function(e){const t=this._baseState;return o(null===t.key),t.key=e,this},h.prototype.any=function(){return this._baseState.any=!0,this},h.prototype.choice=function(e){const t=this._baseState;return o(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},h.prototype.contains=function(e){const t=this._baseState;return o(null===t.use),t.contains=e,this},h.prototype._decode=function(e,t){const r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let i,n=r.default,o=!0,a=null;if(null!==r.key&&(a=e.enterKey(r.key)),r.optional){let i=null;if(null!==r.explicit?i=r.explicit:null!==r.implicit?i=r.implicit:null!==r.tag&&(i=r.tag),null!==i||r.any){if(o=this._peekTag(e,i,r.any),e.isError(o))return o}else{const i=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),o=!0}catch(e){o=!1}e.restore(i)}}if(r.obj&&o&&(i=e.enterObject()),o){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const i=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const i=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(i))return i;r.any?n=e.raw(t):e=i}if(t&&t.track&&null!==r.tag&&t.track(e.path(),i,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(n=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(e,t)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const i=new s(n);n=this._getUse(r.contains,e._reporterState.obj)._decode(i,t)}}return r.obj&&o&&(n=e.leaveObject(i)),null===r.key||null===n&&!0!==o?null!==a&&e.exitKey(a):e.leaveKey(a,r.key,n),n},h.prototype._decodeGeneric=function(e,t,r){const i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},h.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),o(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},h.prototype._decodeChoice=function(e,t){const r=this._baseState;let i=null,n=!1;return Object.keys(r.choice).some((function(s){const o=e.save(),a=r.choice[s];try{const r=a._decode(e,t);if(e.isError(r))return!1;i={type:s,value:r},n=!0}catch(t){return e.restore(o),!1}return!0}),this),n?i:e.error("Choice not matched")},h.prototype._createEncoderBuffer=function(e){return new n(e,this.reporter)},h.prototype._encode=function(e,t,r){const i=this._baseState;if(null!==i.default&&i.default===e)return;const n=this._encodeValue(e,t,r);return void 0===n||this._skipDefault(n,t,r)?void 0:n},h.prototype._encodeValue=function(e,t,r){const n=this._baseState;if(null===n.parent)return n.children[0]._encode(e,t||new i);let s=null;if(this.reporter=t,n.optional&&void 0===e){if(null===n.default)return;e=n.default}let o=null,a=!1;if(n.any)s=this._createEncoderBuffer(e);else if(n.choice)s=this._encodeChoice(e,t);else if(n.contains)o=this._getUse(n.contains,r)._encode(e,t),a=!0;else if(n.children)o=n.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const i=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const n=r._encode(e[r._baseState.key],t,e);return t.leaveKey(i),n}),this).filter((function(e){return e})),o=this._createEncoderBuffer(o);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,o=this._createEncoderBuffer(e.map((function(r){const i=this._baseState;return this._getUse(i.args[0],e)._encode(r,t)}),r))}else null!==n.use?s=this._getUse(n.use,r)._encode(e,t):(o=this._encodePrimitive(n.tag,e),a=!0);if(!n.any&&null===n.choice){const e=null!==n.implicit?n.implicit:n.tag,r=null===n.implicit?"universal":"context";null===e?null===n.use&&t.error("Tag could be omitted only for .use()"):null===n.use&&(s=this._encodeComposite(e,a,r,o))}return null!==n.explicit&&(s=this._encodeComposite(n.explicit,!1,"context",s)),s},h.prototype._encodeChoice=function(e,t){const r=this._baseState,i=r.choice[e.type];return i||o(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(e.value,t)},h.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},h.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},h.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},"../../node_modules/asn1.js/lib/asn1/base/reporter.js":(e,t,r)=>{"use strict";const i=r("../../node_modules/inherits/inherits_browser.js");function n(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function s(e,t){this.path=e,this.rethrow(t)}t.b=n,n.prototype.isError=function(e){return e instanceof s},n.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},n.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},n.prototype.enterKey=function(e){return this._reporterState.path.push(e)},n.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},n.prototype.leaveKey=function(e,t,r){const i=this._reporterState;this.exitKey(e),null!==i.obj&&(i.obj[t]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},n.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},n.prototype.error=function(e){let t;const r=this._reporterState,i=e instanceof s;if(t=i?e:new s(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return i||r.errors.push(t),t},n.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},i(s,Error),s.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,s),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},"../../node_modules/asn1.js/lib/asn1/constants/der.js":(e,t)=>{"use strict";function r(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const i=e[r];t[i]=r})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=r(t.tag)},"../../node_modules/asn1.js/lib/asn1/constants/index.js":(e,t,r)=>{"use strict";const i=t;i._reverse=function(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const i=e[r];t[i]=r})),t},i.der=r("../../node_modules/asn1.js/lib/asn1/constants/der.js")},"../../node_modules/asn1.js/lib/asn1/decoders/der.js":(e,t,r)=>{"use strict";const i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/asn1.js/node_modules/bn.js/lib/bn.js"),s=r("../../node_modules/asn1.js/lib/asn1/base/buffer.js").C,o=r("../../node_modules/asn1.js/lib/asn1/base/node.js"),a=r("../../node_modules/asn1.js/lib/asn1/constants/der.js");function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new h,this.tree._init(e.body)}function h(e){o.call(this,"der",e)}function l(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const i=a.tagClass[r>>6],n=0==(32&r);if(31==(31&r)){let i=r;for(r=0;128==(128&i);){if(i=e.readUInt8(t),e.isError(i))return i;r<<=7,r|=127&i}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:a.tag[r]}}function d(e,t,r){let i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;const n=127&i;if(n>4)return e.error("length octect is too long");i=0;for(let t=0;t{"use strict";const i=t;i.der=r("../../node_modules/asn1.js/lib/asn1/decoders/der.js"),i.pem=r("../../node_modules/asn1.js/lib/asn1/decoders/pem.js")},"../../node_modules/asn1.js/lib/asn1/decoders/pem.js":(e,t,r)=>{"use strict";const i=r("../../node_modules/inherits/inherits_browser.js"),Buffer=r("../../node_modules/safer-buffer/safer.js").Buffer,n=r("../../node_modules/asn1.js/lib/asn1/decoders/der.js");function s(e){n.call(this,e),this.enc="pem"}i(s,n),e.exports=s,s.prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let o=-1,a=-1;for(let e=0;e{"use strict";const i=r("../../node_modules/inherits/inherits_browser.js"),Buffer=r("../../node_modules/safer-buffer/safer.js").Buffer,n=r("../../node_modules/asn1.js/lib/asn1/base/node.js"),s=r("../../node_modules/asn1.js/lib/asn1/constants/der.js");function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new a,this.tree._init(e.body)}function a(e){n.call(this,"der",e)}function u(e){return e<10?"0"+e:e}e.exports=o,o.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},i(a,n),a.prototype._encodeComposite=function(e,t,r,i){const n=function(e,t,r,i){let n;"seqof"===e?e="seq":"setof"===e&&(e="set");if(s.tagByName.hasOwnProperty(e))n=s.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return i.error("Unknown tag: "+e);n=e}if(n>=31)return i.error("Multi-octet tag encoding unsupported");t||(n|=32);return n|=s.tagClassByName[r||"universal"]<<6,n}(e,t,r,this.reporter);if(i.length<128){const e=Buffer.alloc(2);return e[0]=n,e[1]=i.length,this._createEncoderBuffer([e,i])}let o=1;for(let e=i.length;e>=256;e>>=8)o++;const a=Buffer.alloc(2+o);a[0]=n,a[1]=128|o;for(let e=1+o,t=i.length;t>0;e--,t>>=8)a[e]=255&t;return this._createEncoderBuffer([a,i])},a.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=Buffer.alloc(2*e.length);for(let r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let i=0;for(let t=0;t=128;r>>=7)i++}const n=Buffer.alloc(i);let s=n.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(n[s--]=127&r;(r>>=7)>0;)n[s--]=128|127&r}return this._createEncoderBuffer(n)},a.prototype._encodeTime=function(e,t){let r;const i=new Date(e);return"gentime"===t?r=[u(i.getUTCFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(i.getUTCFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},a.prototype._encodeNull=function(){return this._createEncoderBuffer("")},a.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!Buffer.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=Buffer.from(t)}if(Buffer.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=Buffer.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const i=new Array(r);for(let t=i.length-1;t>=0;t--)i[t]=255&e,e>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(Buffer.from(i))},a.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},a.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},a.prototype._skipDefault=function(e,t,r){const i=this._baseState;let n;if(null===i.default)return!1;const s=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),s.length!==i.defaultBuffer.length)return!1;for(n=0;n{"use strict";const i=t;i.der=r("../../node_modules/asn1.js/lib/asn1/encoders/der.js"),i.pem=r("../../node_modules/asn1.js/lib/asn1/encoders/pem.js")},"../../node_modules/asn1.js/lib/asn1/encoders/pem.js":(e,t,r)=>{"use strict";const i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/asn1.js/lib/asn1/encoders/der.js");function s(e){n.call(this,e),this.enc="pem"}i(s,n),e.exports=s,s.prototype.encode=function(e,t){const r=n.prototype.encode.call(this,e).toString("base64"),i=["-----BEGIN "+t.label+"-----"];for(let e=0;e=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=a(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,u=o/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,t.length-1),f=Math.max(0,h-e.length+1);f<=c;f++){var p=h-f|0;l+=(o=(n=0|e.words[p])*(s=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o>>24-n&16777215)||o!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,u="le"===t,h=new e(s),l=this.clone();if(u){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),h[a]=o;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,f=0|o[1],p=8191&f,m=f>>>13,b=0|o[2],g=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,T=0|o[5],I=8191&T,O=T>>>13,A=0|o[6],j=8191&A,k=A>>>13,x=0|o[7],R=8191&x,P=x>>>13,N=0|o[8],C=8191&N,B=N>>>13,U=0|o[9],D=8191&U,L=U>>>13,q=0|a[0],F=8191&q,z=q>>>13,H=0|a[1],V=8191&H,G=H>>>13,W=0|a[2],K=8191&W,$=W>>>13,Z=0|a[3],Y=8191&Z,X=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,le=0|a[8],de=8191&le,ce=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,z))+Math.imul(c,F)|0))<<13)|0;h=((s=Math.imul(c,z))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,s=Math.imul(m,z);var ge=(h+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((s=s+Math.imul(c,G)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,s=Math.imul(y,z),i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,G)|0;var ye=(h+(i=i+Math.imul(d,K)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,K)|0))<<13)|0;h=((s=s+Math.imul(c,$)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(_,F)|0,s=Math.imul(_,z),i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,$)|0;var ve=(h+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,Y)|0))<<13)|0;h=((s=s+Math.imul(c,X)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(S,F)|0,s=Math.imul(S,z),i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(g,K)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,$)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,X)|0;var we=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(c,Q)|0))<<13)|0;h=((s=s+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(O,F)|0,s=Math.imul(O,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,$)|0,i=i+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((s=s+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(k,F)|0,s=Math.imul(k,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(O,V)|0,s=s+Math.imul(O,G)|0,i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,s=s+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(d,se)|0)|0)+((8191&(n=(n=n+Math.imul(d,oe)|0)+Math.imul(c,se)|0))<<13)|0;h=((s=s+Math.imul(c,oe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,z))+Math.imul(P,F)|0,s=Math.imul(P,z),i=i+Math.imul(j,V)|0,n=(n=n+Math.imul(j,G)|0)+Math.imul(k,V)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(O,K)|0,s=s+Math.imul(O,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0;var Ee=(h+(i=i+Math.imul(d,ue)|0)|0)+((8191&(n=(n=n+Math.imul(d,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((s=s+Math.imul(c,he)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,z))+Math.imul(B,F)|0,s=Math.imul(B,z),i=i+Math.imul(R,V)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,$)|0)+Math.imul(k,K)|0,s=s+Math.imul(k,$)|0,i=i+Math.imul(I,Y)|0,n=(n=n+Math.imul(I,X)|0)+Math.imul(O,Y)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(g,se)|0,n=(n=n+Math.imul(g,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,s=s+Math.imul(m,he)|0;var Se=(h+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ce)|0)+Math.imul(c,de)|0))<<13)|0;h=((s=s+Math.imul(c,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,z))+Math.imul(L,F)|0,s=Math.imul(L,z),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,G)|0,i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,K)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,X)|0)+Math.imul(k,Y)|0,s=s+Math.imul(k,X)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(w,se)|0,n=(n=n+Math.imul(w,oe)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(g,ue)|0,n=(n=n+Math.imul(g,he)|0)+Math.imul(y,ue)|0,s=s+Math.imul(y,he)|0,i=i+Math.imul(p,de)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,de)|0,s=s+Math.imul(m,ce)|0;var Te=(h+(i=i+Math.imul(d,pe)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((s=s+Math.imul(c,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,G))+Math.imul(L,V)|0,s=Math.imul(L,G),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,X)|0,i=i+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(O,re)|0,s=s+Math.imul(O,ie)|0,i=i+Math.imul(E,se)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,s=s+Math.imul(_,he)|0,i=i+Math.imul(g,de)|0,n=(n=n+Math.imul(g,ce)|0)+Math.imul(y,de)|0,s=s+Math.imul(y,ce)|0;var Ie=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((s=s+Math.imul(m,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,$))+Math.imul(L,K)|0,s=Math.imul(L,$),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(j,re)|0,n=(n=n+Math.imul(j,ie)|0)+Math.imul(k,re)|0,s=s+Math.imul(k,ie)|0,i=i+Math.imul(I,se)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(O,se)|0,s=s+Math.imul(O,oe)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(S,ue)|0,s=s+Math.imul(S,he)|0,i=i+Math.imul(w,de)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,de)|0,s=s+Math.imul(_,ce)|0;var Oe=(h+(i=i+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,me)|0)+Math.imul(y,pe)|0))<<13)|0;h=((s=s+Math.imul(y,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(L,Y)|0,s=Math.imul(L,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(j,se)|0,n=(n=n+Math.imul(j,oe)|0)+Math.imul(k,se)|0,s=s+Math.imul(k,oe)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(O,ue)|0,s=s+Math.imul(O,he)|0,i=i+Math.imul(E,de)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(S,de)|0,s=s+Math.imul(S,ce)|0;var Ae=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((s=s+Math.imul(_,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(L,Q)|0,s=Math.imul(L,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(B,re)|0,s=s+Math.imul(B,ie)|0,i=i+Math.imul(R,se)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(j,ue)|0,n=(n=n+Math.imul(j,he)|0)+Math.imul(k,ue)|0,s=s+Math.imul(k,he)|0,i=i+Math.imul(I,de)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(O,de)|0,s=s+Math.imul(O,ce)|0;var je=(h+(i=i+Math.imul(E,pe)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;h=((s=s+Math.imul(S,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(L,re)|0,s=Math.imul(L,ie),i=i+Math.imul(C,se)|0,n=(n=n+Math.imul(C,oe)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,oe)|0,i=i+Math.imul(R,ue)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(P,ue)|0,s=s+Math.imul(P,he)|0,i=i+Math.imul(j,de)|0,n=(n=n+Math.imul(j,ce)|0)+Math.imul(k,de)|0,s=s+Math.imul(k,ce)|0;var ke=(h+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((s=s+Math.imul(O,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,se),n=(n=Math.imul(D,oe))+Math.imul(L,se)|0,s=Math.imul(L,oe),i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(B,ue)|0,s=s+Math.imul(B,he)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,ce)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,ce)|0;var xe=(h+(i=i+Math.imul(j,pe)|0)|0)+((8191&(n=(n=n+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((s=s+Math.imul(k,me)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(D,ue),n=(n=Math.imul(D,he))+Math.imul(L,ue)|0,s=Math.imul(L,he),i=i+Math.imul(C,de)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,ce)|0;var Re=(h+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((s=s+Math.imul(P,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,de),n=(n=Math.imul(D,ce))+Math.imul(L,de)|0,s=Math.imul(L,ce);var Pe=(h+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((s=s+Math.imul(B,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(h+(i=Math.imul(D,pe))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(L,pe)|0))<<13)|0;return h=((s=Math.imul(L,me))+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=be,u[1]=ge,u[2]=ye,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Ee,u[8]=Se,u[9]=Te,u[10]=Ie,u[11]=Oe,u[12]=Ae,u[13]=je,u[14]=ke,u[15]=xe,u[16]=Re,u[17]=Pe,u[18]=Ne,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=c),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i>=1;return i},m.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=s>>>26,this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-s|d>>>s,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==t){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/o|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return b[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(e,n.addn(1).iushrn(1)),f=this.pow(e,n),p=o;0!==f.cmp(a);){for(var m=f,b=0;0!==m.cmp(a);b++)m=m.redSqr();i(b=0;i--){for(var h=t.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}u=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},n(E,M),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../transport/lib/sessions/background-sharedworker.js":(e,t,r)=>{"use strict";function i(){return new SharedWorker(r.p+"./workers/sessions-background-sharedworker.f94223d1a920641f41b9.js")}r.r(t),r.d(t,{default:()=>i})},"../analytics/src/index.ts":(e,t,r)=>{"use strict";r.r(t),r.d(t,{Analytics:()=>a,getRandomId:()=>s,getTrackingRandomId:()=>n});var i=r("../utils/lib/index.js");const n=()=>(0,i.getWeakRandomId)(10),s=()=>(0,i.getWeakRandomId)(10),o=async({type:e,url:t,options:r,retry:i})=>{try{const e=await fetch(t,r);e.ok||console.error(`Analytics response not ok. Response status: ${e.status}.`)}catch(n){((e,t,r)=>{let i=r?.error?.message||r?.message;"string"!=typeof i&&(i="Unknown error."),i.includes("Failed to fetch")&&(i="Failed to analytics fetch.");const n=`Analytics report failed. Reporting '${e}' ${t?"again":"was unsuccessful"}. ${i}`;console.error(n)})(e,i,n),i&&setTimeout((()=>o({type:e,url:t,options:r,retry:!1})),1e3)}};class a{enabled=!1;useQueue=!1;queue=new Array;constructor(e,t){this.version=e,this.app=t}init=(e,t)=>{this.enabled=e,this.instanceId=t.instanceId||s(),this.sessionId=t.sessionId||s(),this.commitId=t.commitId,this.url=((e,t,r)=>{let i=`https://data.trezor.io/${e}/log`;return r&&(i=`${i}/${r}`),t?`${i}/develop.log`:`${i}/stable.log`})(this.app,t.isDev,t.environment),this.callbacks=t.callbacks,this.useQueue=!e&&!!t.useQueue};enable=()=>{this.enabled=!0,this.callbacks?.onEnable?.(),this.useQueue&&(this.queue.map((e=>this.report(e))),this.useQueue=!1,this.queue=[])};disable=()=>{this.enabled=!1,this.callbacks?.onDisable?.(),this.useQueue&&(this.useQueue=!1,this.queue=[])};isEnabled=()=>this.enabled;report=(e,t)=>{if(!(this.url&&this.instanceId&&this.sessionId&&this.commitId&&this.version)){const t=(this.url?"":"url, ")+(this.instanceId?"":"instanceId, ")+(this.sessionId?"":"sessionId, ")+(this.commitId?"":"commitId, ")+(this.version?"":"version, ");return void console.error(`Unable to report ${e.type}. Analytics is not initialized! Missing: ${t}`)}const{anonymize:r,force:i}=t??{};if(!this.useQueue||this.enabled||i||this.queue.push(e),!this.enabled&&!i)return;const n=((e,t,r,i,n)=>{const{type:o}=n,a=new URLSearchParams({c_v:i,c_type:o||"",c_commit:r,c_instance_id:e,c_session_id:t,c_timestamp:Date.now().toString(),c_message_id:s()});return n.payload&&Object.entries(n.payload).forEach((([e,t])=>a.append(e,t?.toString()??""))),a.toString()})(r?s():this.instanceId,r?s():this.sessionId,this.commitId,this.version,e);o({type:e.type,url:`${this.url}?${n}`,options:{method:"GET",keepalive:!0},retry:!0})}}},"../blockchain-link-types/lib/constants/errors.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomError=void 0;const r="blockchain_link/",i={worker_not_found:"Worker not found",worker_invalid:"Invalid worker object",worker_timeout:"Worker timeout",worker_unknown_request:"Unknown message type:",worker_runtime:void 0,invalid_param:"Invalid parameter:",websocket_not_initialized:"WebSocket not initialized",websocket_no_url:"Cannot connect because no server was specified",websocket_timeout:"Websocket timeout",websocket_error_message:void 0,websocket_runtime_error:void 0};class n extends Error{constructor(e,t=""){if(super(t),this.message="",this.message=t,"string"==typeof e){const n=0===e.indexOf(r)?e.substring(16,e.length):e;this.code=`${r}${n}`;const s=i[n];"string"==typeof s&&(""===this.message?this.message=s:0===t.indexOf("+")&&(this.message=`${s} ${t.substring(1)}`))}"string"==typeof this.message&&""!==this.message||(this.message="Message not set")}}t.CustomError=n},"../blockchain-link-types/lib/constants/index.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NETWORKS=t.RESPONSES=t.MESSAGES=void 0;const o=s(r("../blockchain-link-types/lib/constants/messages.js"));t.MESSAGES=o;const a=s(r("../blockchain-link-types/lib/constants/responses.js"));t.RESPONSES=a,t.NETWORKS={RIPPLE:"ripple",BLOCKBOOK:"blockbook",BLOCKFROST:"blockfrost"}},"../blockchain-link-types/lib/constants/messages.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TERMINATE=t.PUSH_TRANSACTION=t.UNSUBSCRIBE=t.SUBSCRIBE=t.ESTIMATE_FEE=t.GET_TRANSACTION=t.GET_ACCOUNT_UTXO=t.GET_ACCOUNT_INFO=t.GET_BLOCK=t.GET_BLOCK_HASH=t.GET_FIAT_RATES_TICKERS_LIST=t.GET_ACCOUNT_BALANCE_HISTORY=t.GET_FIAT_RATES_FOR_TIMESTAMPS=t.GET_CURRENT_FIAT_RATES=t.GET_INFO=t.DISCONNECT=t.CONNECT=t.INIT=t.HANDSHAKE=void 0,t.HANDSHAKE="m_handshake",t.INIT="m_init",t.CONNECT="m_connect",t.DISCONNECT="m_disconnect",t.GET_INFO="m_get_info",t.GET_CURRENT_FIAT_RATES="m_get_current_fiat_rates",t.GET_FIAT_RATES_FOR_TIMESTAMPS="m_get_fiat_rates_for_timestamps",t.GET_ACCOUNT_BALANCE_HISTORY="m_get_account_balance_history",t.GET_FIAT_RATES_TICKERS_LIST="m_get_fiat_rates_tickers_list",t.GET_BLOCK_HASH="m_get_block_hash",t.GET_BLOCK="m_get_block",t.GET_ACCOUNT_INFO="m_get_account_info",t.GET_ACCOUNT_UTXO="m_get_account_utxo",t.GET_TRANSACTION="m_get_transaction",t.ESTIMATE_FEE="m_estimate_fee",t.SUBSCRIBE="m_subscribe",t.UNSUBSCRIBE="m_unsubscribe",t.PUSH_TRANSACTION="m_push_tx",t.TERMINATE="terminate"},"../blockchain-link-types/lib/constants/responses.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NOTIFICATION=t.DISCONNECTED=t.CONNECTED=t.PUSH_TRANSACTION=t.UNSUBSCRIBE=t.SUBSCRIBE=t.ESTIMATE_FEE=t.GET_TRANSACTION=t.GET_ACCOUNT_BALANCE_HISTORY=t.GET_ACCOUNT_UTXO=t.GET_ACCOUNT_INFO=t.GET_FIAT_RATES_TICKERS_LIST=t.GET_FIAT_RATES_FOR_TIMESTAMPS=t.GET_CURRENT_FIAT_RATES=t.GET_BLOCK=t.GET_BLOCK_HASH=t.GET_INFO=t.CONNECT=t.ERROR=void 0,t.ERROR="r_error",t.CONNECT="r_connect",t.GET_INFO="r_info",t.GET_BLOCK_HASH="r_get_block_hash",t.GET_BLOCK="r_get_block",t.GET_CURRENT_FIAT_RATES="r_get_current_fiat_rates",t.GET_FIAT_RATES_FOR_TIMESTAMPS="r_get_fiat_rates_for_timestamps",t.GET_FIAT_RATES_TICKERS_LIST="r_GET_FIAT_RATES_TICKERS_LIST",t.GET_ACCOUNT_INFO="r_account_info",t.GET_ACCOUNT_UTXO="r_get_account_utxo",t.GET_ACCOUNT_BALANCE_HISTORY="r_get_account_balance_history",t.GET_TRANSACTION="r_get_transaction",t.ESTIMATE_FEE="r_estimate_fee",t.SUBSCRIBE="r_subscribe",t.UNSUBSCRIBE="r_unsubscribe",t.PUSH_TRANSACTION="r_push_tx",t.CONNECTED="r_connected",t.DISCONNECTED="r_disconnected",t.NOTIFICATION="r_notification"},"../blockchain-link/lib/index.js":(e,t,r)=>{"use strict";const i=r("../utils/lib/typedEventEmitter.js"),n=r("../utils/lib/createDeferred.js"),s=r("../blockchain-link-types/lib/constants/errors.js"),o=r("../blockchain-link-types/lib/constants/index.js"),a=r("../blockchain-link/lib/workers/throttler.js"),u=e=>{const t=(0,n.createDeferred)(-1),r=(e=>{if("function"==typeof e)return e();if("string"==typeof e&&"undefined"!=typeof Worker)return new Worker(e);throw new s.CustomError("worker_not_found")})(e.worker);if("object"!=typeof r||"function"!=typeof r.postMessage)throw new s.CustomError("worker_invalid");const i=setTimeout((()=>{r.onmessage=null,r.onerror=null,t.reject(new s.CustomError("worker_timeout"))}),e.timeout||3e4);return r.onmessage=n=>{n.data.type===o.MESSAGES.HANDSHAKE&&(clearTimeout(i),r.postMessage({type:o.MESSAGES.HANDSHAKE,settings:Object.assign(e,{worker:void 0})}),t.resolve(r))},r.onerror=e=>{clearTimeout(i),r.onmessage=null,r.onerror=null;try{r.terminate()}catch(e){}const n=e.message?`Worker runtime error: Line ${e.lineno} in ${e.filename}: ${e.message}`:"Worker handshake error";t.reject(new s.CustomError("worker_runtime",n))},t.promise};class h extends i.TypedEmitter{constructor(e){super(),this.messageId=0,this.deferred=[],this.onMessage=e=>{if(!e.data)return;const{data:t}=e;if(-1===t.id)return void this.onEvent(t);const r=this.deferred.find((e=>e.id===t.id));r&&(t.type===o.RESPONSES.ERROR?r.reject(new s.CustomError(t.payload.code,t.payload.message)):r.resolve(t.payload),this.deferred=this.deferred.filter((e=>e!==r)))},this.onEvent=e=>{if(e.type===o.RESPONSES.CONNECTED&&this.emit("connected"),e.type===o.RESPONSES.DISCONNECTED&&this.emit("disconnected"),e.type===o.RESPONSES.NOTIFICATION){const t=e.payload;if("block"===t.type)this.throttler.throttle("block",(()=>{this.emit(t.type,t.payload)}));else if("notification"===t.type){const e=`${t.payload.descriptor}:${t.payload.tx.txid}`;this.throttler.throttle(e,(()=>{this.emit(t.type,t.payload)}))}else this.emit(t.type,t.payload)}},this.onError=e=>{const t=e.message?`Worker runtime error: Line ${e.lineno} in ${e.filename}: ${e.message}`:"Worker handshake error",r=new s.CustomError("worker_runtime",t);this.deferred.forEach((e=>{e.reject(r)})),this.deferred=[]},this.settings=e;const t="number"==typeof e.throttleBlockEvent?e.throttleBlockEvent:500;this.throttler=new a.Throttler(t)}async getWorker(){return this.worker||(this.worker=await u(this.settings),this.worker.onmessage=this.onMessage.bind(this),this.worker.onerror=this.onError.bind(this)),this.worker}async sendMessage(e){const t=await this.getWorker(),r=(0,n.createDeferred)(this.messageId);return this.deferred.push(r),t.postMessage(Object.assign({id:this.messageId},e)),this.messageId++,r.promise}connect(){return this.sendMessage({type:o.MESSAGES.CONNECT})}getInfo(){return this.sendMessage({type:o.MESSAGES.GET_INFO})}getBlockHash(e){return this.sendMessage({type:o.MESSAGES.GET_BLOCK_HASH,payload:e})}getBlock(e){return this.sendMessage({type:o.MESSAGES.GET_BLOCK,payload:e})}getAccountInfo(e){return this.sendMessage({type:o.MESSAGES.GET_ACCOUNT_INFO,payload:e})}getAccountUtxo(e){return this.sendMessage({type:o.MESSAGES.GET_ACCOUNT_UTXO,payload:e})}getTransaction(e){return this.sendMessage({type:o.MESSAGES.GET_TRANSACTION,payload:e})}getAccountBalanceHistory(e){return this.sendMessage({type:o.MESSAGES.GET_ACCOUNT_BALANCE_HISTORY,payload:e})}getCurrentFiatRates(e){return this.sendMessage({type:o.MESSAGES.GET_CURRENT_FIAT_RATES,payload:e})}getFiatRatesForTimestamps(e){return this.sendMessage({type:o.MESSAGES.GET_FIAT_RATES_FOR_TIMESTAMPS,payload:e})}getFiatRatesTickersList(e){return this.sendMessage({type:o.MESSAGES.GET_FIAT_RATES_TICKERS_LIST,payload:e})}estimateFee(e){return this.sendMessage({type:o.MESSAGES.ESTIMATE_FEE,payload:e})}subscribe(e){return this.sendMessage({type:o.MESSAGES.SUBSCRIBE,payload:e})}unsubscribe(e){return this.sendMessage({type:o.MESSAGES.UNSUBSCRIBE,payload:e})}pushTransaction(e){return this.sendMessage({type:o.MESSAGES.PUSH_TRANSACTION,payload:e})}async disconnect(){return!this.worker||this.sendMessage({type:o.MESSAGES.DISCONNECT})}dispose(){this.removeAllListeners(),this.throttler.dispose();const{worker:e}=this;e&&(e.terminate(),delete this.worker)}}t.Z=h},"../blockchain-link/lib/workers/throttler.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Throttler=void 0;t.Throttler=class{constructor(e){this.delay=e,this.timeouts={}}throttle(e,t){const r=this.timeouts[e];r&&clearTimeout(r),this.timeouts[e]=setTimeout((()=>{t(),this.cancel(e)}),this.delay)}cancel(e){clearTimeout(this.timeouts[e]),delete this.timeouts[e]}dispose(){Object.keys(this.timeouts).forEach(this.cancel,this)}}},"../connect-analytics/lib/constants.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventType=void 0,function(e){e.AppReady="app/ready",e.AppInfo="app/info",e.ViewChange="view/change",e.ViewChangeError="view/change-error",e.SettingsTracking="settings/tracking",e.SettingsPermissions="settings/permissions",e.WalletType="wallet/type",e.DeviceSelected="device/selected"}(t.EventType||(t.EventType={}))},"../connect-analytics/lib/index.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.getRandomId=t.analytics=void 0;const s=r("../analytics/src/index.ts");Object.defineProperty(t,"getRandomId",{enumerable:!0,get:function(){return s.getRandomId}});const o=new s.Analytics("9.0.0","connect");t.analytics=o,n(r("../connect-analytics/lib/types/events.js"),t),n(r("../connect-analytics/lib/constants.js"),t)},"../connect-analytics/lib/types/events.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect-common/lib/index.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.storage=void 0;var s=r("../connect-common/lib/storage.js");t.storage=s,n(r("../connect-common/lib/systemInfo.js"),t)},"../connect-common/lib/storage.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.load=t.save=void 0;var i="storage_v".concat(1),n={},s=function(){var e=localStorage.getItem(i);return e?JSON.parse(e):{}};t.save=function(e,t){if(void 0===t&&(t=!1),!t&&r.g.window){var o=e(s());localStorage.setItem(i,JSON.stringify(o))}else n=e(n)};t.load=function(e){var t;return void 0===e&&(e=!1),e||!(null===(t=null===r.g||void 0===r.g?void 0:r.g.window)||void 0===t?void 0:t.localStorage)?n:s()}},"../connect-common/lib/systemInfo.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSystemInfo=t.getInstallerPackage=void 0;var i=r("../env-utils/lib/index.js");t.getInstallerPackage=function(){var e=(0,i.getUserAgent)();switch((0,i.getOsFamily)()){case"MacOS":return"mac";case"Windows":var t=e.match(/(Win64|WOW64)/)?"64":"32";return"win".concat(t);case"Linux":var r=e.match(/CentOS|Fedora|Mandriva|Mageia|Red Hat|Scientific|SUSE/)?"rpm":"deb",n=e.match(/Linux i[3456]86/)?"32":"64";return"".concat(r).concat(n)}};t.getSystemInfo=function(e){var t=(0,i.getBrowserName)(),r=(0,i.getBrowserVersion)(),n=t?e[t.toLowerCase()]:void 0,s=!!n&&n.version>parseInt(r,10),o="mobile"===(0,i.getDeviceType)(),a=!o||"usb"in navigator,u=!(!n||s||!a);return{os:{family:(0,i.getOsFamily)(),mobile:o},browser:{supported:u,outdated:s}}}},"../connect/lib/constants/cardano.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NETWORK_IDS=t.PROTOCOL_MAGICS=void 0,function(e){e[e.mainnet=764824073]="mainnet",e[e.testnet_preprod=1]="testnet_preprod",e[e.testnet_preview=2]="testnet_preview",e[e.testnet_legacy=1097911063]="testnet_legacy"}(t.PROTOCOL_MAGICS||(t.PROTOCOL_MAGICS={})),function(e){e[e.mainnet=1]="mainnet",e[e.testnet=0]="testnet"}(t.NETWORK_IDS||(t.NETWORK_IDS={}))},"../connect/lib/constants/errors.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LIBUSB_ERROR_MESSAGE=t.serializeError=t.TypedError=t.TrezorError=t.ERROR_CODES=void 0,t.ERROR_CODES={Init_NotInitialized:"TrezorConnect not initialized",Init_AlreadyInitialized:"TrezorConnect has been already initialized",Init_IframeBlocked:"Iframe blocked",Init_IframeTimeout:"Iframe timeout",Init_ManifestMissing:"Manifest not set. Read more at https://github.com/trezor/trezor-suite/blob/develop/docs/packages/connect/index.md",Popup_ConnectionMissing:"Unable to establish connection with iframe",Transport_Missing:"Transport is missing",Transport_InvalidProtobuf:"",Method_InvalidPackage:"This package is not suitable to work with browser. Use @trezor/connect-web package instead",Method_InvalidParameter:"",Method_NotAllowed:"Method not allowed for this configuration",Method_PermissionsNotGranted:"Permissions not granted",Method_Cancel:"Cancelled",Method_Interrupted:"Popup closed",Method_UnknownCoin:"Coin not found",Method_AddressNotMatch:"Addresses do not match",Method_FirmwareUpdate_DownloadFailed:"Failed to download firmware binary",Method_Discovery_BundleException:"",Method_Override:"override",Method_NoResponse:"Call resolved without response",Backend_NotSupported:"BlockchainLink settings not found in coins.json",Backend_WorkerMissing:"",Backend_Disconnected:"Backend disconnected",Backend_Invalid:"Invalid backend",Backend_Error:"",Runtime:"",Device_NotFound:"Device not found",Device_InitializeFailed:"",Device_FwException:"",Device_ModeException:"",Device_Disconnected:"Device disconnected",Device_UsedElsewhere:"Device is used in another window",Device_InvalidState:"Passphrase is incorrect",Device_CallInProgress:"Device call in progress"};class r extends Error{constructor(e,t){super(t),this.code=e,this.message=t}}t.TrezorError=r;t.TypedError=(e,i)=>new r(e,i||t.ERROR_CODES[e]);t.serializeError=e=>e&&e.error instanceof Error?{error:e.error.message,code:e.error.code}:e,t.LIBUSB_ERROR_MESSAGE="LIBUSB_ERROR"},"../connect/lib/constants/index.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PROTO=t.NEM=t.CARDANO=t.NETWORK=t.ERRORS=void 0;const i=r("../../node_modules/tslib/tslib.es6.mjs");t.ERRORS=i.__importStar(r("../connect/lib/constants/errors.js")),t.NETWORK=i.__importStar(r("../connect/lib/constants/network.js")),t.CARDANO=i.__importStar(r("../connect/lib/constants/cardano.js")),t.NEM=i.__importStar(r("../connect/lib/constants/nem.js")),t.PROTO=i.__importStar(r("../protobuf/lib/messages.js"))},"../connect/lib/constants/nem.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TxVersion=t.TxType=t.Networks=void 0,function(e){e[e.mainnet=104]="mainnet",e[e.testnet=152]="testnet",e[e.mijin=96]="mijin"}(t.Networks||(t.Networks={})),function(e){e[e.TRANSFER=257]="TRANSFER",e[e.COSIGNING=258]="COSIGNING",e[e.IMPORTANCE_TRANSFER=2049]="IMPORTANCE_TRANSFER",e[e.AGGREGATE_MODIFICATION=4097]="AGGREGATE_MODIFICATION",e[e.MULTISIG_SIGNATURE=4098]="MULTISIG_SIGNATURE",e[e.MULTISIG=4100]="MULTISIG",e[e.PROVISION_NAMESPACE=8193]="PROVISION_NAMESPACE",e[e.MOSAIC_CREATION=16385]="MOSAIC_CREATION",e[e.SUPPLY_CHANGE=16386]="SUPPLY_CHANGE"}(t.TxType||(t.TxType={})),function(e){e[e.mainnet=1744830464]="mainnet",e[e.testnet=-1744830464]="testnet",e[e.mijin=1610612736]="mijin"}(t.TxVersion||(t.TxVersion={}))},"../connect/lib/constants/network.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES=void 0,t.TYPES={bitcoin:"Bitcoin",ethereum:"Ethereum",eos:"Eos",nem:"NEM",stellar:"Stellar",cardano:"Cardano",ripple:"Ripple",tezos:"Tezos",binance:"Binance"}},"../connect/lib/data/connectSettings.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseConnectSettings=t.corsValidator=t.DEFAULT_PRIORITY=void 0;const i=r("../connect/lib/data/version.js");t.DEFAULT_PRIORITY=2;const n={configSrc:"./data/config.json",version:i.VERSION,debug:!1,priority:t.DEFAULT_PRIORITY,trustedHost:!0,connectSrc:i.DEFAULT_DOMAIN,iframeSrc:`${i.DEFAULT_DOMAIN}iframe.html`,popup:!1,popupSrc:`${i.DEFAULT_DOMAIN}popup.html`,webusbSrc:`${i.DEFAULT_DOMAIN}webusb.html`,transports:void 0,pendingTransportEvent:!0,env:"node",lazyLoad:!1,timestamp:(new Date).getTime(),interactionTimeout:600};t.corsValidator=e=>{if("string"==typeof e)return e.match(/^https:\/\/([A-Za-z0-9\-_]+\.)*trezor\.io\//)||e.match(/^https?:\/\/localhost:[58][0-9]{3}\//)||e.match(/^https:\/\/([A-Za-z0-9\-_]+\.)*sldev\.cz\//)||e.match(/^https?:\/\/([A-Za-z0-9\-_]+\.)*trezoriovpjcahpzkrewelclulmszwbqpzmzgub37gbcjlvluxtruqad\.onion\//)?e:void 0};t.parseConnectSettings=(e={})=>{var r;const s={...n};"debug"in e&&("boolean"==typeof e.debug?s.debug=e.debug:"string"==typeof e.debug&&(s.debug="true"===e.debug)),"string"==typeof e.connectSrc&&(null===(r=e.connectSrc)||void 0===r?void 0:r.startsWith("http"))?s.connectSrc=(0,t.corsValidator)(e.connectSrc):s.trustedHost&&(s.connectSrc=e.connectSrc);const o=s.connectSrc||i.DEFAULT_DOMAIN;return s.iframeSrc=`${o}iframe.html`,s.popupSrc=`${o}popup.html`,s.webusbSrc=`${o}webusb.html`,"boolean"==typeof e.transportReconnect&&(s.transportReconnect=e.transportReconnect),"boolean"==typeof e.webusb&&(s.webusb=e.webusb),Array.isArray(e.transports)&&(s.transports=e.transports),"boolean"==typeof e.popup&&(s.popup=e.popup),"boolean"==typeof e.lazyLoad&&(s.lazyLoad=e.lazyLoad),"boolean"==typeof e.pendingTransportEvent&&(s.pendingTransportEvent=e.pendingTransportEvent),"string"==typeof e.extension&&(s.extension=e.extension),"string"==typeof e.env&&(s.env=e.env),"number"==typeof e.timestamp&&(s.timestamp=e.timestamp),"number"==typeof e.interactionTimeout&&(s.interactionTimeout=e.interactionTimeout),"object"==typeof e.manifest&&(s.manifest=(e=>{if(e&&"string"==typeof e.email&&"string"==typeof e.appUrl)return{email:e.email,appUrl:e.appUrl}})(e.manifest)),s}},"../connect/lib/data/version.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_DOMAIN=t.VERSION=void 0,t.VERSION="9.1.4";const r=t.VERSION.split(".").map((e=>parseInt(e,10)));t.DEFAULT_DOMAIN=`https://connect.trezor.io/${r[0]}/`},"../connect/lib/events/blockchain.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBlockchainMessage=t.BLOCKCHAIN=t.BLOCKCHAIN_EVENT=void 0,t.BLOCKCHAIN_EVENT="BLOCKCHAIN_EVENT",t.BLOCKCHAIN={CONNECT:"blockchain-connect",ERROR:"blockchain-error",BLOCK:"blockchain-block",NOTIFICATION:"blockchain-notification",FIAT_RATES_UPDATE:"fiat-rates-update"};t.createBlockchainMessage=(e,r)=>({event:t.BLOCKCHAIN_EVENT,type:e,payload:r})},"../connect/lib/events/call.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseMessage=t.RESPONSE_EVENT=void 0;const i=r("../connect/lib/constants/errors.js");t.RESPONSE_EVENT="RESPONSE_EVENT";t.createResponseMessage=(e,r,n)=>({event:t.RESPONSE_EVENT,type:t.RESPONSE_EVENT,id:e,success:r,payload:r?n:(0,i.serializeError)(n)})},"../connect/lib/events/core.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorMessage=t.parseMessage=t.CORE_EVENT=void 0,t.CORE_EVENT="CORE_EVENT";t.parseMessage=e=>{const t={event:e.event,type:e.type,payload:e.payload};return"number"==typeof e.id&&(t.id=e.id),"boolean"==typeof e.success&&(t.success=e.success),t};t.createErrorMessage=e=>({success:!1,payload:{error:e.message,code:e.code}})},"../connect/lib/events/device.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDeviceMessage=t.DEVICE=t.DEVICE_EVENT=void 0,t.DEVICE_EVENT="DEVICE_EVENT",t.DEVICE={CONNECT:"device-connect",CONNECT_UNACQUIRED:"device-connect_unacquired",DISCONNECT:"device-disconnect",CHANGED:"device-changed",ACQUIRE:"device-acquire",RELEASE:"device-release",ACQUIRED:"device-acquired",RELEASED:"device-released",USED_ELSEWHERE:"device-used_elsewhere",LOADING:"device-loading",BUTTON:"button",PIN:"pin",PASSPHRASE:"passphrase",PASSPHRASE_ON_DEVICE:"passphrase_on_device",WORD:"word"};t.createDeviceMessage=(e,r)=>({event:t.DEVICE_EVENT,type:e,payload:r})},"../connect/lib/events/iframe.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIFrameMessage=t.IFRAME=void 0;const i=r("../connect/lib/events/ui-request.js");t.IFRAME={BOOTSTRAP:"iframe-bootstrap",LOADED:"iframe-loaded",INIT:"iframe-init",ERROR:"iframe-error",CALL:"iframe-call",LOG:"iframe-log"};t.createIFrameMessage=(e,t)=>({event:i.UI_EVENT,type:e,payload:t})},"../connect/lib/events/index.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UI=void 0;const i=r("../../node_modules/tslib/tslib.es6.mjs"),n=r("../connect/lib/events/ui-request.js"),s=r("../connect/lib/events/ui-response.js");i.__exportStar(r("../connect/lib/events/blockchain.js"),t),i.__exportStar(r("../connect/lib/events/call.js"),t),i.__exportStar(r("../connect/lib/events/core.js"),t),i.__exportStar(r("../connect/lib/events/device.js"),t),i.__exportStar(r("../connect/lib/events/iframe.js"),t),i.__exportStar(r("../connect/lib/events/popup.js"),t),i.__exportStar(r("../connect/lib/events/transport.js"),t),i.__exportStar(r("../connect/lib/events/ui-promise.js"),t),i.__exportStar(r("../connect/lib/events/ui-request.js"),t),i.__exportStar(r("../connect/lib/events/ui-response.js"),t),t.UI={...n.UI_REQUEST,...s.UI_RESPONSE}},"../connect/lib/events/popup.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPopupMessage=t.POPUP=void 0;const i=r("../connect/lib/events/ui-request.js");t.POPUP={BOOTSTRAP:"popup-bootstrap",LOADED:"popup-loaded",INIT:"popup-init",ERROR:"popup-error",EXTENSION_USB_PERMISSIONS:"open-usb-permissions",HANDSHAKE:"popup-handshake",CLOSED:"popup-closed",CANCEL_POPUP_REQUEST:"ui-cancel-popup-request",CLOSE_WINDOW:"window.close",ANALYTICS_RESPONSE:"popup-analytics-response"};t.createPopupMessage=(e,t)=>({event:i.UI_EVENT,type:e,payload:t})},"../connect/lib/events/transport.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTransportMessage=t.TRANSPORT_EVENT=t.TRANSPORT=void 0;const i=r("../connect/lib/constants/errors.js");var n=r("../transport/lib/constants.js");Object.defineProperty(t,"TRANSPORT",{enumerable:!0,get:function(){return n.TRANSPORT}}),t.TRANSPORT_EVENT="TRANSPORT_EVENT";t.createTransportMessage=(e,r)=>({event:t.TRANSPORT_EVENT,type:e,payload:"error"in r?(0,i.serializeError)(r):r})},"../connect/lib/events/ui-promise.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/events/ui-request.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUiMessage=t.UI_REQUEST=t.UI_EVENT=void 0,t.UI_EVENT="UI_EVENT",t.UI_REQUEST={TRANSPORT:"ui-no_transport",BOOTLOADER:"ui-device_bootloader_mode",NOT_IN_BOOTLOADER:"ui-device_not_in_bootloader_mode",REQUIRE_MODE:"ui-device_require_mode",INITIALIZE:"ui-device_not_initialized",SEEDLESS:"ui-device_seedless",FIRMWARE_OLD:"ui-device_firmware_old",FIRMWARE_OUTDATED:"ui-device_firmware_outdated",FIRMWARE_NOT_SUPPORTED:"ui-device_firmware_unsupported",FIRMWARE_NOT_COMPATIBLE:"ui-device_firmware_not_compatible",FIRMWARE_NOT_INSTALLED:"ui-device_firmware_not_installed",FIRMWARE_PROGRESS:"ui-firmware-progress",DEVICE_NEEDS_BACKUP:"ui-device_needs_backup",REQUEST_UI_WINDOW:"ui-request_window",CLOSE_UI_WINDOW:"ui-close_window",REQUEST_PERMISSION:"ui-request_permission",REQUEST_CONFIRMATION:"ui-request_confirmation",REQUEST_PIN:"ui-request_pin",INVALID_PIN:"ui-invalid_pin",REQUEST_PASSPHRASE:"ui-request_passphrase",REQUEST_PASSPHRASE_ON_DEVICE:"ui-request_passphrase_on_device",INVALID_PASSPHRASE:"ui-invalid_passphrase",CONNECT:"ui-connect",LOADING:"ui-loading",SET_OPERATION:"ui-set_operation",SELECT_DEVICE:"ui-select_device",SELECT_ACCOUNT:"ui-select_account",SELECT_FEE:"ui-select_fee",UPDATE_CUSTOM_FEE:"ui-update_custom_fee",INSUFFICIENT_FUNDS:"ui-insufficient_funds",REQUEST_BUTTON:"ui-button",REQUEST_WORD:"ui-request_word",LOGIN_CHALLENGE_REQUEST:"ui-login_challenge_request",BUNDLE_PROGRESS:"ui-bundle_progress",ADDRESS_VALIDATION:"ui-address_validation",IFRAME_FAILURE:"ui-iframe_failure"};t.createUiMessage=(e,r)=>({event:t.UI_EVENT,type:e,payload:r})},"../connect/lib/events/ui-response.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createUiResponse=t.UI_RESPONSE=void 0;const i=r("../connect/lib/events/ui-request.js");t.UI_RESPONSE={RECEIVE_PERMISSION:"ui-receive_permission",RECEIVE_CONFIRMATION:"ui-receive_confirmation",RECEIVE_PIN:"ui-receive_pin",RECEIVE_PASSPHRASE:"ui-receive_passphrase",RECEIVE_DEVICE:"ui-receive_device",RECEIVE_ACCOUNT:"ui-receive_account",RECEIVE_FEE:"ui-receive_fee",RECEIVE_WORD:"ui-receive_word",INVALID_PASSPHRASE_ACTION:"ui-invalid_passphrase_action",CHANGE_SETTINGS:"ui-change_settings",LOGIN_CHALLENGE_RESPONSE:"ui-login_challenge_response"};t.createUiResponse=(e,t)=>({event:i.UI_EVENT,type:e,payload:t})},"../connect/lib/exports.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseConnectSettings=void 0;const i=r("../../node_modules/tslib/tslib.es6.mjs");i.__exportStar(r("../connect/lib/constants/index.js"),t),i.__exportStar(r("../connect/lib/events/index.js"),t),i.__exportStar(r("../connect/lib/types/index.js"),t);var n=r("../connect/lib/data/connectSettings.js");Object.defineProperty(t,"parseConnectSettings",{enumerable:!0,get:function(){return n.parseConnectSettings}})},"../connect/lib/factory.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.factory=void 0;const i=r("../connect/lib/events/index.js");t.factory=({eventEmitter:e,manifest:t,init:r,call:n,requestLogin:s,uiResponse:o,renderWebUSBButton:a,disableWebUSB:u,requestWebUSBDevice:h,cancel:l,dispose:d})=>({manifest:t,init:r,getSettings:()=>n({method:"getSettings"}),on:(t,r)=>{e.on(t,r)},off:(t,r)=>{e.removeListener(t,r)},removeAllListeners:t=>{"string"==typeof t?e.removeAllListeners(t):e.removeAllListeners()},uiResponse:o,blockchainGetAccountBalanceHistory:e=>n({...e,method:"blockchainGetAccountBalanceHistory"}),blockchainGetCurrentFiatRates:e=>n({...e,method:"blockchainGetCurrentFiatRates"}),blockchainGetFiatRatesForTimestamps:e=>n({...e,method:"blockchainGetFiatRatesForTimestamps"}),blockchainDisconnect:e=>n({...e,method:"blockchainDisconnect"}),blockchainEstimateFee:e=>n({...e,method:"blockchainEstimateFee"}),blockchainGetTransactions:e=>n({...e,method:"blockchainGetTransactions"}),blockchainSetCustomBackend:e=>n({...e,method:"blockchainSetCustomBackend"}),blockchainSubscribe:e=>n({...e,method:"blockchainSubscribe"}),blockchainSubscribeFiatRates:e=>n({...e,method:"blockchainSubscribeFiatRates"}),blockchainUnsubscribe:e=>n({...e,method:"blockchainUnsubscribe"}),blockchainUnsubscribeFiatRates:e=>n({...e,method:"blockchainUnsubscribeFiatRates"}),requestLogin:e=>s(e),cardanoGetAddress:t=>n({...t,method:"cardanoGetAddress",useEventListener:e.listenerCount(i.UI.ADDRESS_VALIDATION)>0}),cardanoGetNativeScriptHash:e=>n({...e,method:"cardanoGetNativeScriptHash"}),cardanoGetPublicKey:e=>n({...e,method:"cardanoGetPublicKey"}),cardanoSignTransaction:e=>n({...e,method:"cardanoSignTransaction"}),cipherKeyValue:e=>n({...e,method:"cipherKeyValue"}),composeTransaction:e=>n({...e,method:"composeTransaction"}),ethereumGetAddress:t=>n({...t,method:"ethereumGetAddress",useEventListener:e.listenerCount(i.UI.ADDRESS_VALIDATION)>0}),ethereumGetPublicKey:e=>n({...e,method:"ethereumGetPublicKey"}),ethereumSignMessage:e=>n({...e,method:"ethereumSignMessage"}),ethereumSignTransaction:e=>n({...e,method:"ethereumSignTransaction"}),ethereumSignTypedData:e=>n({...e,method:"ethereumSignTypedData"}),ethereumVerifyMessage:e=>n({...e,method:"ethereumVerifyMessage"}),getAccountInfo:e=>n({...e,method:"getAccountInfo"}),getAddress:t=>n({...t,method:"getAddress",useEventListener:e.listenerCount(i.UI.ADDRESS_VALIDATION)>0}),getDeviceState:e=>n({...e,method:"getDeviceState"}),getFeatures:e=>n({...e,method:"getFeatures"}),getFirmwareHash:e=>n({...e,method:"getFirmwareHash"}),getOwnershipId:e=>n({...e,method:"getOwnershipId"}),getOwnershipProof:e=>n({...e,method:"getOwnershipProof"}),getPublicKey:e=>n({...e,method:"getPublicKey"}),nemGetAddress:t=>n({...t,method:"nemGetAddress",useEventListener:e.listenerCount(i.UI.ADDRESS_VALIDATION)>0}),nemSignTransaction:e=>n({...e,method:"nemSignTransaction"}),pushTransaction:e=>n({...e,method:"pushTransaction"}),rippleGetAddress:t=>n({...t,method:"rippleGetAddress",useEventListener:e.listenerCount(i.UI.ADDRESS_VALIDATION)>0}),rippleSignTransaction:e=>n({...e,method:"rippleSignTransaction"}),signMessage:e=>n({...e,method:"signMessage"}),signTransaction:e=>n({...e,method:"signTransaction"}),stellarGetAddress:t=>n({...t,method:"stellarGetAddress",useEventListener:e.listenerCount(i.UI.ADDRESS_VALIDATION)>0}),stellarSignTransaction:e=>n({...e,method:"stellarSignTransaction"}),tezosGetAddress:t=>n({...t,method:"tezosGetAddress",useEventListener:e.listenerCount(i.UI.ADDRESS_VALIDATION)>0}),tezosGetPublicKey:e=>n({...e,method:"tezosGetPublicKey"}),tezosSignTransaction:e=>n({...e,method:"tezosSignTransaction"}),unlockPath:e=>n({...e,method:"unlockPath"}),eosGetPublicKey:e=>n({...e,method:"eosGetPublicKey"}),eosSignTransaction:e=>n({...e,method:"eosSignTransaction"}),binanceGetAddress:t=>n({...t,method:"binanceGetAddress",useEventListener:e.listenerCount(i.UI.ADDRESS_VALIDATION)>0}),binanceGetPublicKey:e=>n({...e,method:"binanceGetPublicKey"}),binanceSignTransaction:e=>n({...e,method:"binanceSignTransaction"}),verifyMessage:e=>n({...e,method:"verifyMessage"}),resetDevice:e=>n({...e,method:"resetDevice"}),wipeDevice:e=>n({...e,method:"wipeDevice"}),checkFirmwareAuthenticity:e=>n({...e,method:"checkFirmwareAuthenticity"}),applyFlags:e=>n({...e,method:"applyFlags"}),applySettings:e=>n({...e,method:"applySettings"}),authorizeCoinjoin:e=>n({...e,method:"authorizeCoinjoin"}),cancelCoinjoinAuthorization:e=>n({...e,method:"cancelCoinjoinAuthorization"}),showDeviceTutorial:e=>n({...e,method:"showDeviceTutorial"}),backupDevice:e=>n({...e,method:"backupDevice"}),changePin:e=>n({...e,method:"changePin"}),firmwareUpdate:e=>n({...e,method:"firmwareUpdate"}),recoveryDevice:e=>n({...e,method:"recoveryDevice"}),getCoinInfo:e=>n({...e,method:"getCoinInfo"}),rebootToBootloader:e=>n({...e,method:"rebootToBootloader"}),setBusy:e=>n({...e,method:"setBusy"}),setProxy:e=>n({...e,method:"setProxy"}),dispose:d,cancel:l,renderWebUSBButton:a,disableWebUSB:u,requestWebUSBDevice:h})},"../connect/lib/index-browser.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r("../../node_modules/tslib/tslib.es6.mjs"),n=r("../connect/lib/constants/errors.js"),s=()=>{throw(0,n.TypedError)("Method_InvalidPackage")},o=(0,r("../connect/lib/factory.js").factory)({eventEmitter:{on:s,off:s,removeAllListeners:s,listenerCount:s},manifest:s,init:s,call:s,requestLogin:s,requestWebUSBDevice:s,uiResponse:s,renderWebUSBButton:s,disableWebUSB:s,cancel:s,dispose:s});t.default=o,i.__exportStar(r("../connect/lib/exports.js"),t)},"../connect/lib/types/account.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/api/binance/index.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/api/bitcoin/index.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/api/cardano/index.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/api/eos/index.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/api/ethereum/index.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/api/index.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/api/ripple/index.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/api/stellar/index.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/api/tezos/index.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/coinInfo.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/device.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceModelInternal=t.FirmwareType=void 0,function(e){e.BitcoinOnly="bitcoin-only",e.Regular="regular"}(t.FirmwareType||(t.FirmwareType={}));var i=r("../protobuf/lib/messages.js");Object.defineProperty(t,"DeviceModelInternal",{enumerable:!0,get:function(){return i.DeviceModelInternal}})},"../connect/lib/types/fees.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/firmware.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/index.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r("../../node_modules/tslib/tslib.es6.mjs");i.__exportStar(r("../connect/lib/types/api/index.js"),t),i.__exportStar(r("../connect/lib/types/account.js"),t),i.__exportStar(r("../connect/lib/types/coinInfo.js"),t),i.__exportStar(r("../connect/lib/types/device.js"),t),i.__exportStar(r("../connect/lib/types/fees.js"),t),i.__exportStar(r("../connect/lib/types/firmware.js"),t),i.__exportStar(r("../connect/lib/types/params.js"),t),i.__exportStar(r("../connect/lib/types/settings.js"),t),i.__exportStar(r("../connect/lib/types/api/cardano/index.js"),t),i.__exportStar(r("../connect/lib/types/api/binance/index.js"),t),i.__exportStar(r("../connect/lib/types/api/bitcoin/index.js"),t),i.__exportStar(r("../connect/lib/types/api/eos/index.js"),t),i.__exportStar(r("../connect/lib/types/api/ripple/index.js"),t),i.__exportStar(r("../connect/lib/types/api/ethereum/index.js"),t),i.__exportStar(r("../connect/lib/types/api/stellar/index.js"),t),i.__exportStar(r("../connect/lib/types/api/tezos/index.js"),t)},"../connect/lib/types/params.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../connect/lib/types/settings.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../env-utils/lib/envUtils.js":function(e,t,r){"use strict";var i=r("../../node_modules/process/browser.js"),n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.envUtils=t.getEnvironment=t.isDesktop=t.isWeb=void 0;const s=n(r("../../node_modules/ua-parser-js/src/ua-parser.js"));t.isWeb=()=>"web"==={VERSION:"9.0.0",COMMIT_HASH:"109db0a3f6fc6fc5cdb24098ee50480692c92dbf"}.SUITE_TYPE;t.isDesktop=()=>"desktop"==={VERSION:"9.0.0",COMMIT_HASH:"109db0a3f6fc6fc5cdb24098ee50480692c92dbf"}.SUITE_TYPE;let o;t.getEnvironment=()=>(0,t.isWeb)()?"web":"desktop";const a=()=>window.navigator.userAgent,u=()=>{if(!o){const e=a();o=new s.default(e)}return o},h=()=>/Android/.test(a()),l=()=>/CrOS/.test(a()),d=()=>{const e=u().getBrowser().name;return(null==e?void 0:e.toLowerCase())||""},c=()=>window.navigator.platform,f=()=>i.platform,p=()=>"darwin"===f()||("undefined"!=typeof window?c().startsWith("Mac"):void 0),m=()=>"win32"===f()||("undefined"!=typeof window?c().startsWith("Win"):void 0),b=()=>["iPhone","iPad","iPod"].includes(c()),g=()=>"linux"===f()||("undefined"!=typeof window?!h()&&!l()&&c().startsWith("Linux"):void 0);t.envUtils={isWeb:t.isWeb,isDesktop:t.isDesktop,getEnvironment:t.getEnvironment,getUserAgent:a,isAndroid:h,isChromeOs:l,getOsVersion:()=>u().getOS().version||"",getBrowserName:d,getBrowserVersion:()=>u().getBrowser().version||"",getCommitHash:()=>({VERSION:"9.0.0",COMMIT_HASH:"109db0a3f6fc6fc5cdb24098ee50480692c92dbf"}.COMMITHASH||""),getDeviceType:()=>u().getDevice().type,getSuiteVersion:()=>"9.0.0",isFirefox:()=>"firefox"===d(),getPlatform:c,getPlatformLanguages:()=>window.navigator.languages,getScreenWidth:()=>window.screen.width,getScreenHeight:()=>window.screen.height,getWindowWidth:()=>window.innerWidth,getWindowHeight:()=>window.innerHeight,getLocationOrigin:()=>window.location.origin,getLocationHostname:()=>window.location.hostname,getProcessPlatform:f,isMacOs:p,isWindows:m,isIOs:b,isLinux:g,getOsName:()=>m()?"windows":p()?"macos":h()?"android":l()?"chromeos":g()?"linux":b()?"ios":"",getOsNameWeb:()=>u().getOS().name,getOsFamily:()=>{const e=u().getOS().name;return"Windows"===e?"Windows":"Mac OS"===e?"MacOS":"Linux"}}},"../env-utils/lib/index.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOsFamily=t.getOsNameWeb=t.getOsName=t.isLinux=t.isIOs=t.isWindows=t.isMacOs=t.getProcessPlatform=t.getLocationHostname=t.getLocationOrigin=t.getWindowHeight=t.getWindowWidth=t.getScreenHeight=t.getScreenWidth=t.getPlatformLanguages=t.getPlatform=t.isFirefox=t.getSuiteVersion=t.getOsVersion=t.getDeviceType=t.getCommitHash=t.getBrowserName=t.getBrowserVersion=t.isChromeOs=t.isAndroid=t.getUserAgent=t.getEnvironment=t.isDesktop=t.isWeb=void 0;const i=r("../env-utils/lib/envUtils.js");t.isWeb=i.envUtils.isWeb,t.isDesktop=i.envUtils.isDesktop,t.getEnvironment=i.envUtils.getEnvironment,t.getUserAgent=i.envUtils.getUserAgent,t.isAndroid=i.envUtils.isAndroid,t.isChromeOs=i.envUtils.isChromeOs,t.getBrowserVersion=i.envUtils.getBrowserVersion,t.getBrowserName=i.envUtils.getBrowserName,t.getCommitHash=i.envUtils.getCommitHash,t.getDeviceType=i.envUtils.getDeviceType,t.getOsVersion=i.envUtils.getOsVersion,t.getSuiteVersion=i.envUtils.getSuiteVersion,t.isFirefox=i.envUtils.isFirefox,t.getPlatform=i.envUtils.getPlatform,t.getPlatformLanguages=i.envUtils.getPlatformLanguages,t.getScreenWidth=i.envUtils.getScreenWidth,t.getScreenHeight=i.envUtils.getScreenHeight,t.getWindowWidth=i.envUtils.getWindowWidth,t.getWindowHeight=i.envUtils.getWindowHeight,t.getLocationOrigin=i.envUtils.getLocationOrigin,t.getLocationHostname=i.envUtils.getLocationHostname,t.getProcessPlatform=i.envUtils.getProcessPlatform,t.isMacOs=i.envUtils.isMacOs,t.isWindows=i.envUtils.isWindows,t.isIOs=i.envUtils.isIOs,t.isLinux=i.envUtils.isLinux,t.getOsName=i.envUtils.getOsName,t.getOsNameWeb=i.envUtils.getOsNameWeb,t.getOsFamily=i.envUtils.getOsFamily},"../protobuf/lib/decode.js":function(e,t,r){"use strict";var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n{if((0,o.isPrimitiveField)(e.type))return e.optional&&void 0===t?null:"bytes"===e.type?s.default.wrap(t).toString("hex"):e.long?Number.isSafeInteger(t.toNumber())?t.toNumber():t.toString():t;if("valuesById"in e.resolvedType)return e.resolvedType.valuesById[t];if(e.resolvedType.fields)return u(t,e.resolvedType.fields);throw new Error(`transport: decode: case not handled: ${e}`)};function u(e,t){const r=i(e,[]),n={};return Object.keys(t).forEach((e=>{const i=t[e],s=r[e];i.repeated?n[e]=s.map((e=>a(i,e))):n[e]=a(i,s)})),n}t.messageToJSON=u;t.decode=(e,t)=>{const r=t.toBuffer(),i=new Uint8Array(r),n=e.decode(i);return u(n,n.$type.fields)}},"../protobuf/lib/encode.js":function(e,t,r){"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.patch=void 0;const n=i(r("../../node_modules/bytebuffer/dist/bytebuffer.js")),s=r("../protobuf/lib/utils.js"),o=(e,t)=>{if("bytes"===e)return"string"!=typeof t||t?Buffer.from(t,"hex"):t;if("number"==typeof t&&!Number.isSafeInteger(t))throw new RangeError("field value is not within safe integer range");return t};function a(e,t){const r={};return e.fields?(Object.keys(e.fields).forEach((i=>{const n=e.fields[i],u=t[i];if(void 0!==u)if((0,s.isPrimitiveField)(n.type))n.repeated?r[i]=u.map((e=>o(n.type,e))):r[i]=o(n.type,u);else if(n.repeated){const t=e.lookupTypeOrEnum(n.type);r[i]=u.map((e=>a(t,e)))}else if("object"==typeof u&&null!==u){const t=e.lookupType(n.type);r[i]=a(t,u)}else if("number"==typeof u){const t=e.lookupEnum(n.type);r[i]=t.values[u]}else r[i]=u})),r):r}t.patch=a;t.encode=(e,t)=>{const r=a(e,t),i=e.fromObject(r),s=e.encode(i).finish(),o=new n.default(s.byteLength);return o.append(s),o.reset(),o}},"../protobuf/lib/index.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageFromType=t.createMessageFromName=t.parseConfigure=t.Messages=void 0,s(r("../protobuf/lib/decode.js"),t),s(r("../protobuf/lib/encode.js"),t),t.Messages=o(r("../protobuf/lib/messages.js")),s(r("../protobuf/lib/types.js"),t);var a=r("../protobuf/lib/utils.js");Object.defineProperty(t,"parseConfigure",{enumerable:!0,get:function(){return a.parseConfigure}}),Object.defineProperty(t,"createMessageFromName",{enumerable:!0,get:function(){return a.createMessageFromName}}),Object.defineProperty(t,"createMessageFromType",{enumerable:!0,get:function(){return a.createMessageFromType}})},"../protobuf/lib/messages.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TezosBallotType=t.TezosContractType=t.StellarSignerType=t.StellarMemoType=t.StellarAssetType=t.NEMImportanceTransferMode=t.NEMModificationType=t.NEMSupplyChangeType=t.NEMMosaicLevy=t.MoneroNetworkType=t.Enum_WordRequestType=t.RecoveryDeviceType=t.SdProtectOperationType=t.Enum_Capability=t.Enum_HomescreenFormat=t.Enum_SafetyCheckLevel=t.Enum_BackupType=t.EthereumDataType=t.EthereumDefinitionType=t.DebugPhysicalButton=t.DebugButton=t.Enum_PinMatrixRequestType=t.Enum_ButtonRequestType=t.FailureType=t.CardanoTxWitnessType=t.CardanoTxSigningMode=t.CardanoCVoteRegistrationFormat=t.CardanoTxAuxiliaryDataSupplementType=t.CardanoPoolRelayType=t.CardanoCertificateType=t.CardanoTxOutputSerializationFormat=t.CardanoNativeScriptHashDisplayFormat=t.CardanoNativeScriptType=t.CardanoAddressType=t.CardanoDerivationType=t.Enum_RequestType=t.AmountUnit=t.DecredStakingSpendType=t.Enum_OutputScriptType=t.Enum_InputScriptType=t.BinanceTimeInForce=t.BinanceOrderSide=t.BinanceOrderType=t.DeviceModelInternal=void 0,function(e){e.T1B1="T1B1",e.T2T1="T2T1",e.T2B1="T2B1"}(t.DeviceModelInternal||(t.DeviceModelInternal={})),function(e){e[e.OT_UNKNOWN=0]="OT_UNKNOWN",e[e.MARKET=1]="MARKET",e[e.LIMIT=2]="LIMIT",e[e.OT_RESERVED=3]="OT_RESERVED"}(t.BinanceOrderType||(t.BinanceOrderType={})),function(e){e[e.SIDE_UNKNOWN=0]="SIDE_UNKNOWN",e[e.BUY=1]="BUY",e[e.SELL=2]="SELL"}(t.BinanceOrderSide||(t.BinanceOrderSide={})),function(e){e[e.TIF_UNKNOWN=0]="TIF_UNKNOWN",e[e.GTE=1]="GTE",e[e.TIF_RESERVED=2]="TIF_RESERVED",e[e.IOC=3]="IOC"}(t.BinanceTimeInForce||(t.BinanceTimeInForce={})),function(e){e[e.SPENDADDRESS=0]="SPENDADDRESS",e[e.SPENDMULTISIG=1]="SPENDMULTISIG",e[e.EXTERNAL=2]="EXTERNAL",e[e.SPENDWITNESS=3]="SPENDWITNESS",e[e.SPENDP2SHWITNESS=4]="SPENDP2SHWITNESS",e[e.SPENDTAPROOT=5]="SPENDTAPROOT"}(t.Enum_InputScriptType||(t.Enum_InputScriptType={})),function(e){e[e.PAYTOADDRESS=0]="PAYTOADDRESS",e[e.PAYTOSCRIPTHASH=1]="PAYTOSCRIPTHASH",e[e.PAYTOMULTISIG=2]="PAYTOMULTISIG",e[e.PAYTOOPRETURN=3]="PAYTOOPRETURN",e[e.PAYTOWITNESS=4]="PAYTOWITNESS",e[e.PAYTOP2SHWITNESS=5]="PAYTOP2SHWITNESS",e[e.PAYTOTAPROOT=6]="PAYTOTAPROOT"}(t.Enum_OutputScriptType||(t.Enum_OutputScriptType={})),function(e){e[e.SSGen=0]="SSGen",e[e.SSRTX=1]="SSRTX"}(t.DecredStakingSpendType||(t.DecredStakingSpendType={})),function(e){e[e.BITCOIN=0]="BITCOIN",e[e.MILLIBITCOIN=1]="MILLIBITCOIN",e[e.MICROBITCOIN=2]="MICROBITCOIN",e[e.SATOSHI=3]="SATOSHI"}(t.AmountUnit||(t.AmountUnit={})),function(e){e[e.TXINPUT=0]="TXINPUT",e[e.TXOUTPUT=1]="TXOUTPUT",e[e.TXMETA=2]="TXMETA",e[e.TXFINISHED=3]="TXFINISHED",e[e.TXEXTRADATA=4]="TXEXTRADATA",e[e.TXORIGINPUT=5]="TXORIGINPUT",e[e.TXORIGOUTPUT=6]="TXORIGOUTPUT",e[e.TXPAYMENTREQ=7]="TXPAYMENTREQ"}(t.Enum_RequestType||(t.Enum_RequestType={})),function(e){e[e.LEDGER=0]="LEDGER",e[e.ICARUS=1]="ICARUS",e[e.ICARUS_TREZOR=2]="ICARUS_TREZOR"}(t.CardanoDerivationType||(t.CardanoDerivationType={})),function(e){e[e.BASE=0]="BASE",e[e.BASE_SCRIPT_KEY=1]="BASE_SCRIPT_KEY",e[e.BASE_KEY_SCRIPT=2]="BASE_KEY_SCRIPT",e[e.BASE_SCRIPT_SCRIPT=3]="BASE_SCRIPT_SCRIPT",e[e.POINTER=4]="POINTER",e[e.POINTER_SCRIPT=5]="POINTER_SCRIPT",e[e.ENTERPRISE=6]="ENTERPRISE",e[e.ENTERPRISE_SCRIPT=7]="ENTERPRISE_SCRIPT",e[e.BYRON=8]="BYRON",e[e.REWARD=14]="REWARD",e[e.REWARD_SCRIPT=15]="REWARD_SCRIPT"}(t.CardanoAddressType||(t.CardanoAddressType={})),function(e){e[e.PUB_KEY=0]="PUB_KEY",e[e.ALL=1]="ALL",e[e.ANY=2]="ANY",e[e.N_OF_K=3]="N_OF_K",e[e.INVALID_BEFORE=4]="INVALID_BEFORE",e[e.INVALID_HEREAFTER=5]="INVALID_HEREAFTER"}(t.CardanoNativeScriptType||(t.CardanoNativeScriptType={})),function(e){e[e.HIDE=0]="HIDE",e[e.BECH32=1]="BECH32",e[e.POLICY_ID=2]="POLICY_ID"}(t.CardanoNativeScriptHashDisplayFormat||(t.CardanoNativeScriptHashDisplayFormat={})),function(e){e[e.ARRAY_LEGACY=0]="ARRAY_LEGACY",e[e.MAP_BABBAGE=1]="MAP_BABBAGE"}(t.CardanoTxOutputSerializationFormat||(t.CardanoTxOutputSerializationFormat={})),function(e){e[e.STAKE_REGISTRATION=0]="STAKE_REGISTRATION",e[e.STAKE_DEREGISTRATION=1]="STAKE_DEREGISTRATION",e[e.STAKE_DELEGATION=2]="STAKE_DELEGATION",e[e.STAKE_POOL_REGISTRATION=3]="STAKE_POOL_REGISTRATION"}(t.CardanoCertificateType||(t.CardanoCertificateType={})),function(e){e[e.SINGLE_HOST_IP=0]="SINGLE_HOST_IP",e[e.SINGLE_HOST_NAME=1]="SINGLE_HOST_NAME",e[e.MULTIPLE_HOST_NAME=2]="MULTIPLE_HOST_NAME"}(t.CardanoPoolRelayType||(t.CardanoPoolRelayType={})),function(e){e[e.NONE=0]="NONE",e[e.CVOTE_REGISTRATION_SIGNATURE=1]="CVOTE_REGISTRATION_SIGNATURE"}(t.CardanoTxAuxiliaryDataSupplementType||(t.CardanoTxAuxiliaryDataSupplementType={})),function(e){e[e.CIP15=0]="CIP15",e[e.CIP36=1]="CIP36"}(t.CardanoCVoteRegistrationFormat||(t.CardanoCVoteRegistrationFormat={})),function(e){e[e.ORDINARY_TRANSACTION=0]="ORDINARY_TRANSACTION",e[e.POOL_REGISTRATION_AS_OWNER=1]="POOL_REGISTRATION_AS_OWNER",e[e.MULTISIG_TRANSACTION=2]="MULTISIG_TRANSACTION",e[e.PLUTUS_TRANSACTION=3]="PLUTUS_TRANSACTION"}(t.CardanoTxSigningMode||(t.CardanoTxSigningMode={})),function(e){e[e.BYRON_WITNESS=0]="BYRON_WITNESS",e[e.SHELLEY_WITNESS=1]="SHELLEY_WITNESS"}(t.CardanoTxWitnessType||(t.CardanoTxWitnessType={})),function(e){e[e.Failure_UnexpectedMessage=1]="Failure_UnexpectedMessage",e[e.Failure_ButtonExpected=2]="Failure_ButtonExpected",e[e.Failure_DataError=3]="Failure_DataError",e[e.Failure_ActionCancelled=4]="Failure_ActionCancelled",e[e.Failure_PinExpected=5]="Failure_PinExpected",e[e.Failure_PinCancelled=6]="Failure_PinCancelled",e[e.Failure_PinInvalid=7]="Failure_PinInvalid",e[e.Failure_InvalidSignature=8]="Failure_InvalidSignature",e[e.Failure_ProcessError=9]="Failure_ProcessError",e[e.Failure_NotEnoughFunds=10]="Failure_NotEnoughFunds",e[e.Failure_NotInitialized=11]="Failure_NotInitialized",e[e.Failure_PinMismatch=12]="Failure_PinMismatch",e[e.Failure_WipeCodeMismatch=13]="Failure_WipeCodeMismatch",e[e.Failure_InvalidSession=14]="Failure_InvalidSession",e[e.Failure_FirmwareError=99]="Failure_FirmwareError"}(t.FailureType||(t.FailureType={})),function(e){e[e.ButtonRequest_Other=1]="ButtonRequest_Other",e[e.ButtonRequest_FeeOverThreshold=2]="ButtonRequest_FeeOverThreshold",e[e.ButtonRequest_ConfirmOutput=3]="ButtonRequest_ConfirmOutput",e[e.ButtonRequest_ResetDevice=4]="ButtonRequest_ResetDevice",e[e.ButtonRequest_ConfirmWord=5]="ButtonRequest_ConfirmWord",e[e.ButtonRequest_WipeDevice=6]="ButtonRequest_WipeDevice",e[e.ButtonRequest_ProtectCall=7]="ButtonRequest_ProtectCall",e[e.ButtonRequest_SignTx=8]="ButtonRequest_SignTx",e[e.ButtonRequest_FirmwareCheck=9]="ButtonRequest_FirmwareCheck",e[e.ButtonRequest_Address=10]="ButtonRequest_Address",e[e.ButtonRequest_PublicKey=11]="ButtonRequest_PublicKey",e[e.ButtonRequest_MnemonicWordCount=12]="ButtonRequest_MnemonicWordCount",e[e.ButtonRequest_MnemonicInput=13]="ButtonRequest_MnemonicInput",e[e._Deprecated_ButtonRequest_PassphraseType=14]="_Deprecated_ButtonRequest_PassphraseType",e[e.ButtonRequest_UnknownDerivationPath=15]="ButtonRequest_UnknownDerivationPath",e[e.ButtonRequest_RecoveryHomepage=16]="ButtonRequest_RecoveryHomepage",e[e.ButtonRequest_Success=17]="ButtonRequest_Success",e[e.ButtonRequest_Warning=18]="ButtonRequest_Warning",e[e.ButtonRequest_PassphraseEntry=19]="ButtonRequest_PassphraseEntry",e[e.ButtonRequest_PinEntry=20]="ButtonRequest_PinEntry"}(t.Enum_ButtonRequestType||(t.Enum_ButtonRequestType={})),function(e){e[e.PinMatrixRequestType_Current=1]="PinMatrixRequestType_Current",e[e.PinMatrixRequestType_NewFirst=2]="PinMatrixRequestType_NewFirst",e[e.PinMatrixRequestType_NewSecond=3]="PinMatrixRequestType_NewSecond",e[e.PinMatrixRequestType_WipeCodeFirst=4]="PinMatrixRequestType_WipeCodeFirst",e[e.PinMatrixRequestType_WipeCodeSecond=5]="PinMatrixRequestType_WipeCodeSecond"}(t.Enum_PinMatrixRequestType||(t.Enum_PinMatrixRequestType={})),function(e){e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.INFO=2]="INFO"}(t.DebugButton||(t.DebugButton={})),function(e){e[e.LEFT_BTN=0]="LEFT_BTN",e[e.MIDDLE_BTN=1]="MIDDLE_BTN",e[e.RIGHT_BTN=2]="RIGHT_BTN"}(t.DebugPhysicalButton||(t.DebugPhysicalButton={})),function(e){e[e.NETWORK=0]="NETWORK",e[e.TOKEN=1]="TOKEN"}(t.EthereumDefinitionType||(t.EthereumDefinitionType={})),function(e){e[e.UINT=1]="UINT",e[e.INT=2]="INT",e[e.BYTES=3]="BYTES",e[e.STRING=4]="STRING",e[e.BOOL=5]="BOOL",e[e.ADDRESS=6]="ADDRESS",e[e.ARRAY=7]="ARRAY",e[e.STRUCT=8]="STRUCT"}(t.EthereumDataType||(t.EthereumDataType={})),function(e){e[e.Bip39=0]="Bip39",e[e.Slip39_Basic=1]="Slip39_Basic",e[e.Slip39_Advanced=2]="Slip39_Advanced"}(t.Enum_BackupType||(t.Enum_BackupType={})),function(e){e[e.Strict=0]="Strict",e[e.PromptAlways=1]="PromptAlways",e[e.PromptTemporarily=2]="PromptTemporarily"}(t.Enum_SafetyCheckLevel||(t.Enum_SafetyCheckLevel={})),function(e){e[e.Toif=1]="Toif",e[e.Jpeg=2]="Jpeg",e[e.ToiG=3]="ToiG"}(t.Enum_HomescreenFormat||(t.Enum_HomescreenFormat={})),function(e){e[e.Capability_Bitcoin=1]="Capability_Bitcoin",e[e.Capability_Bitcoin_like=2]="Capability_Bitcoin_like",e[e.Capability_Binance=3]="Capability_Binance",e[e.Capability_Cardano=4]="Capability_Cardano",e[e.Capability_Crypto=5]="Capability_Crypto",e[e.Capability_EOS=6]="Capability_EOS",e[e.Capability_Ethereum=7]="Capability_Ethereum",e[e.Capability_Lisk=8]="Capability_Lisk",e[e.Capability_Monero=9]="Capability_Monero",e[e.Capability_NEM=10]="Capability_NEM",e[e.Capability_Ripple=11]="Capability_Ripple",e[e.Capability_Stellar=12]="Capability_Stellar",e[e.Capability_Tezos=13]="Capability_Tezos",e[e.Capability_U2F=14]="Capability_U2F",e[e.Capability_Shamir=15]="Capability_Shamir",e[e.Capability_ShamirGroups=16]="Capability_ShamirGroups",e[e.Capability_PassphraseEntry=17]="Capability_PassphraseEntry"}(t.Enum_Capability||(t.Enum_Capability={})),function(e){e[e.DISABLE=0]="DISABLE",e[e.ENABLE=1]="ENABLE",e[e.REFRESH=2]="REFRESH"}(t.SdProtectOperationType||(t.SdProtectOperationType={})),function(e){e[e.RecoveryDeviceType_ScrambledWords=0]="RecoveryDeviceType_ScrambledWords",e[e.RecoveryDeviceType_Matrix=1]="RecoveryDeviceType_Matrix"}(t.RecoveryDeviceType||(t.RecoveryDeviceType={})),function(e){e[e.WordRequestType_Plain=0]="WordRequestType_Plain",e[e.WordRequestType_Matrix9=1]="WordRequestType_Matrix9",e[e.WordRequestType_Matrix6=2]="WordRequestType_Matrix6"}(t.Enum_WordRequestType||(t.Enum_WordRequestType={})),function(e){e[e.MAINNET=0]="MAINNET",e[e.TESTNET=1]="TESTNET",e[e.STAGENET=2]="STAGENET",e[e.FAKECHAIN=3]="FAKECHAIN"}(t.MoneroNetworkType||(t.MoneroNetworkType={})),function(e){e[e.MosaicLevy_Absolute=1]="MosaicLevy_Absolute",e[e.MosaicLevy_Percentile=2]="MosaicLevy_Percentile"}(t.NEMMosaicLevy||(t.NEMMosaicLevy={})),function(e){e[e.SupplyChange_Increase=1]="SupplyChange_Increase",e[e.SupplyChange_Decrease=2]="SupplyChange_Decrease"}(t.NEMSupplyChangeType||(t.NEMSupplyChangeType={})),function(e){e[e.CosignatoryModification_Add=1]="CosignatoryModification_Add",e[e.CosignatoryModification_Delete=2]="CosignatoryModification_Delete"}(t.NEMModificationType||(t.NEMModificationType={})),function(e){e[e.ImportanceTransfer_Activate=1]="ImportanceTransfer_Activate",e[e.ImportanceTransfer_Deactivate=2]="ImportanceTransfer_Deactivate"}(t.NEMImportanceTransferMode||(t.NEMImportanceTransferMode={})),function(e){e[e.NATIVE=0]="NATIVE",e[e.ALPHANUM4=1]="ALPHANUM4",e[e.ALPHANUM12=2]="ALPHANUM12"}(t.StellarAssetType||(t.StellarAssetType={})),function(e){e[e.NONE=0]="NONE",e[e.TEXT=1]="TEXT",e[e.ID=2]="ID",e[e.HASH=3]="HASH",e[e.RETURN=4]="RETURN"}(t.StellarMemoType||(t.StellarMemoType={})),function(e){e[e.ACCOUNT=0]="ACCOUNT",e[e.PRE_AUTH=1]="PRE_AUTH",e[e.HASH=2]="HASH"}(t.StellarSignerType||(t.StellarSignerType={})),function(e){e[e.Implicit=0]="Implicit",e[e.Originated=1]="Originated"}(t.TezosContractType||(t.TezosContractType={})),function(e){e[e.Yay=0]="Yay",e[e.Nay=1]="Nay",e[e.Pass=2]="Pass"}(t.TezosBallotType||(t.TezosBallotType={}))},"../protobuf/lib/types.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../protobuf/lib/utils.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageFromType=t.createMessageFromName=t.parseConfigure=t.isPrimitiveField=void 0;const o=s(r("../../node_modules/protobufjs/light.js")),a=["bool","string","bytes","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","double","float"];t.isPrimitiveField=e=>a.includes(e),t.parseConfigure=function(e){return"string"==typeof e?o.Root.fromJSON(JSON.parse(e)):o.Root.fromJSON(e)};t.createMessageFromName=(e,t)=>{const r=e.lookupType(t);let i=e.lookupEnum("MessageType").values[`MessageType_${t}`];return!i&&r.options&&(i=r.options["(wire_type)"]),{Message:r,messageType:i}};t.createMessageFromType=(e,t)=>{const r=e.lookupEnum("MessageType").valuesById[t].replace("MessageType_","");return{Message:e.lookupType(r),messageName:r}}},"../protocol/lib/errors.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PROTOCOL_MALFORMED=void 0,t.PROTOCOL_MALFORMED="Malformed protocol format"},"../protocol/lib/index.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.trzd=t.bridge=t.v1=void 0,t.v1=s(r("../protocol/lib/protocol-v1/index.js")),t.bridge=s(r("../protocol/lib/protocol-bridge/index.js")),t.trzd=s(r("../protocol/lib/protocol-trzd/index.js")),o(r("../protocol/lib/errors.js"),t)},"../protocol/lib/protocol-bridge/decode.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=void 0;t.decode=e=>{const{typeId:t}={typeId:(r=e).readUint16(),length:r.readUint32()};var r;return{typeId:t,buffer:e}}},"../protocol/lib/protocol-bridge/encode.js":function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encode=void 0;const n=i(r("../../node_modules/bytebuffer/dist/bytebuffer.js")),s=r("../protocol/lib/protocol-v1/constants.js");t.encode=(e,t)=>{const{messageType:r}=t,i=s.HEADER_SIZE-2+e.limit,o=new n.default(i);return o.writeUint16(r),o.writeUint32(e.limit),o.append(e.buffer),o.reset(),o}},"../protocol/lib/protocol-bridge/index.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r("../protocol/lib/protocol-bridge/decode.js"),t),n(r("../protocol/lib/protocol-bridge/encode.js"),t)},"../protocol/lib/protocol-trzd/decode.js":function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decode=void 0;const n=i(r("../../node_modules/bytebuffer/dist/bytebuffer.js"));t.decode=e=>{const t=n.default.wrap(e),r=t.readBytes(5).toUTF8(),i=t.readUint8(),s=t.readUint32(),o=t.readUint8();return{magic:r,definitionType:i,dataVersion:s,protobufLength:o,protobufPayload:t.slice(12,12+o)}}},"../protocol/lib/protocol-trzd/index.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r("../protocol/lib/protocol-trzd/decode.js"),t)},"../protocol/lib/protocol-v1/constants.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BUFFER_SIZE=t.HEADER_SIZE=t.MESSAGE_HEADER_BYTE=t.MESSAGE_MAGIC_HEADER_BYTE=void 0,t.MESSAGE_MAGIC_HEADER_BYTE=63,t.MESSAGE_HEADER_BYTE=35,t.HEADER_SIZE=8,t.BUFFER_SIZE=64},"../protocol/lib/protocol-v1/decode.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeChunked=void 0;const a=o(r("../../node_modules/bytebuffer/dist/bytebuffer.js")),u=s(r("../protocol/lib/errors.js")),h=r("../protocol/lib/protocol-v1/constants.js");t.decodeChunked=e=>{const t=a.default.wrap(e,void 0,void 0,!0),{magic:r,sharp1:i,sharp2:n,typeId:s,length:o}={magic:(l=t).readByte(),sharp1:l.readByte(),sharp2:l.readByte(),typeId:l.readUint16(),length:l.readUint32()};var l;if(r!==h.MESSAGE_MAGIC_HEADER_BYTE||i!==h.MESSAGE_HEADER_BYTE||n!==h.MESSAGE_HEADER_BYTE)throw new Error(u.PROTOCOL_MALFORMED);return{length:o,typeId:s,restBuffer:t}}},"../protocol/lib/protocol-v1/encode.js":function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encode=void 0;const n=i(r("../../node_modules/bytebuffer/dist/bytebuffer.js")),s=r("../protocol/lib/protocol-v1/constants.js");t.encode=(e,t)=>{const{messageType:r}=t,i=s.HEADER_SIZE+e.limit,o=new n.default(i);o.writeByte(s.MESSAGE_HEADER_BYTE),o.writeByte(s.MESSAGE_HEADER_BYTE),o.writeUint16(r),o.writeUint32(e.limit),o.append(e.buffer),o.reset();const a=s.BUFFER_SIZE-1,u=Math.ceil(o.limit/a)||1,h=[];for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TRANSPORT=t.ACTION_TIMEOUT=t.TREZOR_USB_DESCRIPTORS=t.T1_HID_VENDOR=t.ENDPOINT_ID=t.INTERFACE_ID=t.CONFIGURATION_ID=void 0,t.CONFIGURATION_ID=1,t.INTERFACE_ID=0,t.ENDPOINT_ID=1,t.T1_HID_VENDOR=21324,t.TREZOR_USB_DESCRIPTORS=[{vendorId:21324,productId:1},{vendorId:4617,productId:21440},{vendorId:4617,productId:21441}],t.ACTION_TIMEOUT=1e4,t.TRANSPORT={START:"transport-start",ERROR:"transport-error",UPDATE:"transport-update",DISABLE_WEBUSB:"transport-disable_webusb",REQUEST_DEVICE:"transport-request_device"}},"../transport/lib/errors.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ABORTED_BY_TIMEOUT=t.ABORTED_BY_SIGNAL=t.UNEXPECTED_ERROR=t.HTTP_ERROR=t.OTHER_CALL_IN_PROGRESS=t.DEVICE_DISCONNECTED_DURING_ACTION=t.WRONG_ENVIRONMENT=t.WRONG_RESULT_TYPE=t.NATIVE_INTERFACE_NOT_AVAILABLE=t.ALREADY_LISTENING=t.SESSION_BACKGROUND_TIMEOUT=t.SESSION_NOT_FOUND=t.SESSION_WRONG_PREVIOUS=t.DEVICE_UNREADABLE=t.DEVICE_NOT_FOUND=t.INTERFACE_DATA_TRANSFER=t.INTERFACE_UNABLE_TO_CLOSE_DEVICE=t.INTERFACE_UNABLE_TO_OPEN_DEVICE=void 0,t.INTERFACE_UNABLE_TO_OPEN_DEVICE="Unable to open device",t.INTERFACE_UNABLE_TO_CLOSE_DEVICE="Unable to close device",t.INTERFACE_DATA_TRANSFER="A transfer error has occurred.",t.DEVICE_NOT_FOUND="device not found",t.DEVICE_UNREADABLE="Device unreadable",t.SESSION_WRONG_PREVIOUS="wrong previous session",t.SESSION_NOT_FOUND="session not found",t.SESSION_BACKGROUND_TIMEOUT="sessions background did not respond",t.ALREADY_LISTENING="already listening",t.NATIVE_INTERFACE_NOT_AVAILABLE="interface not available",t.WRONG_RESULT_TYPE="Wrong result type.",t.WRONG_ENVIRONMENT="This transport can not be used in this environment",t.DEVICE_DISCONNECTED_DURING_ACTION="device disconnected during action",t.OTHER_CALL_IN_PROGRESS="other call in progress",t.HTTP_ERROR="Network request failed",t.UNEXPECTED_ERROR="unexpected error",t.ABORTED_BY_SIGNAL="Aborted by signal",t.ABORTED_BY_TIMEOUT="Aborted by timeout"},"../transport/lib/index.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.UdpTransport=t.SessionsClient=t.SessionsBackground=t.NodeUsbTransport=t.WebUsbTransport=t.BridgeTransport=t.Messages=t.Transport=t.TRANSPORT=t.TREZOR_USB_DESCRIPTORS=t.TRANSPORT_ERROR=void 0;const a=s(r("../../node_modules/protobufjs/light.js")),u=o(r("../../node_modules/long/src/long.js"));t.TRANSPORT_ERROR=s(r("../transport/lib/errors.js")),a.util.Long=u.default,a.configure();var h=r("../transport/lib/constants.js");Object.defineProperty(t,"TREZOR_USB_DESCRIPTORS",{enumerable:!0,get:function(){return h.TREZOR_USB_DESCRIPTORS}}),Object.defineProperty(t,"TRANSPORT",{enumerable:!0,get:function(){return h.TRANSPORT}});var l=r("../transport/lib/transports/abstract.js");Object.defineProperty(t,"Transport",{enumerable:!0,get:function(){return l.AbstractTransport}});var d=r("../protobuf/lib/index.js");Object.defineProperty(t,"Messages",{enumerable:!0,get:function(){return d.Messages}});var c=r("../transport/lib/transports/bridge.js");Object.defineProperty(t,"BridgeTransport",{enumerable:!0,get:function(){return c.BridgeTransport}});var f=r("../transport/lib/transports/webusb.browser.js");Object.defineProperty(t,"WebUsbTransport",{enumerable:!0,get:function(){return f.WebUsbTransport}});var p=r("../transport/lib/transports/nodeusb.browser.js");Object.defineProperty(t,"NodeUsbTransport",{enumerable:!0,get:function(){return p.NodeUsbTransport}});var m=r("../transport/lib/sessions/background.js");Object.defineProperty(t,"SessionsBackground",{enumerable:!0,get:function(){return m.SessionsBackground}});var b=r("../transport/lib/sessions/client.js");Object.defineProperty(t,"SessionsClient",{enumerable:!0,get:function(){return b.SessionsClient}});var g=r("../transport/lib/transports/udp.browser.js");Object.defineProperty(t,"UdpTransport",{enumerable:!0,get:function(){return g.UdpTransport}})},"../transport/lib/interfaces/abstract.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractInterface=void 0;const i=r("../utils/lib/typedEventEmitter.js"),n=r("../transport/lib/utils/result.js");class s extends i.TypedEmitter{constructor({logger:e}){super(),this.logger=e||{debug:(...e)=>{},log:(...e)=>{},warn:(...e)=>{},error:(...e)=>{}}}success(e){return(0,n.success)(e)}error(e){return(0,n.error)(e)}unknownError(e,t){return(0,n.unknownError)(e,t)}}t.AbstractInterface=s},"../transport/lib/interfaces/usb.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=i))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.UsbInterface=void 0;const u=r("../transport/lib/interfaces/abstract.js"),h=r("../transport/lib/constants.js"),l=r("../utils/lib/index.js"),d=o(r("../transport/lib/errors.js")),c="The device was disconnected.";class f extends u.AbstractInterface{constructor({usbInterface:e,logger:t}){super({logger:t}),this.devices=[],this.usbInterface=e,this.usbInterface&&(this.usbInterface.onconnect=e=>{this.devices=[...this.devices,...this.createDevices([e.device])],this.emit("transport-interface-change",this.devices.map((e=>e.path)))},this.usbInterface.ondisconnect=e=>{const{device:t}=e;if(!t.serialNumber)return this.emit("transport-interface-error",d.DEVICE_UNREADABLE),void this.logger.error("device does not have serial number");const r=this.devices.findIndex((e=>e.path===t.serialNumber));r>-1?(this.devices.splice(r,1),this.emit("transport-interface-change",this.devices.map((e=>e.path)))):(this.emit("transport-interface-error",d.DEVICE_NOT_FOUND),this.logger.error("device that should be removed does not exist in state"))})}enumerate(){return a(this,void 0,void 0,(function*(){try{const e=yield this.usbInterface.getDevices(),[t,r]=this.filterDevices(e);return t.length&&this.logger.error("unreadable hid device connected"),this.devices=this.createDevices(r),this.success(this.devices.map((e=>e.path)))}catch(e){return this.unknownError(e,[])}}))}read(e){return a(this,void 0,void 0,(function*(){const t=this.findDevice(e);if(!t)return this.error({error:d.DEVICE_NOT_FOUND});try{const e=yield t.transferIn(h.ENDPOINT_ID,64);return e.data?this.success(e.data.buffer):this.error({error:d.INTERFACE_DATA_TRANSFER})}catch(e){return e.message===c?this.error({error:d.DEVICE_DISCONNECTED_DURING_ACTION}):this.error({error:d.INTERFACE_DATA_TRANSFER,message:e.message})}}))}write(e,t){return a(this,void 0,void 0,(function*(){const r=this.findDevice(e);if(!r)return this.error({error:d.DEVICE_NOT_FOUND});const i=new Uint8Array(64);i.set(new Uint8Array(t));try{const e=yield r.transferOut(h.ENDPOINT_ID,i);if("ok"!==e.status)throw this.logger.error("transport","usbInterface","write","result.status",e.status),new Error("transfer out status not ok");return this.success(void 0)}catch(e){return e.message===c?this.error({error:d.DEVICE_DISCONNECTED_DURING_ACTION}):this.error({error:d.INTERFACE_DATA_TRANSFER,message:e.message})}}))}openDevice(e,t){return a(this,void 0,void 0,(function*(){for(let r=0;r<5;r++){const i=yield this.openInternal(e,t);if(i.success)return i;yield(0,l.createTimeoutPromise)(100*r)}return this.openInternal(e,t)}))}openInternal(e,t){return a(this,void 0,void 0,(function*(){const r=this.findDevice(e);if(!r)return this.error({error:d.DEVICE_NOT_FOUND});try{yield r.open()}catch(e){return this.error({error:d.INTERFACE_UNABLE_TO_OPEN_DEVICE,message:e.message})}if(t)try{yield r.selectConfiguration(h.CONFIGURATION_ID),yield r.reset()}catch(e){}try{yield r.claimInterface(h.INTERFACE_ID)}catch(e){return this.error({error:d.INTERFACE_UNABLE_TO_OPEN_DEVICE,message:e.message})}return this.success(void 0)}))}closeDevice(e){return a(this,void 0,void 0,(function*(){const t=this.findDevice(e);if(!t)return this.error({error:d.DEVICE_NOT_FOUND});if(t.opened)try{const e=h.INTERFACE_ID;yield t.releaseInterface(e)}catch(e){}if(t.opened)try{yield t.close()}catch(e){return this.error({error:d.INTERFACE_UNABLE_TO_CLOSE_DEVICE,message:e.message})}return this.success(void 0)}))}findDevice(e){const t=this.devices.find((t=>t.path===e));if(t)return t.device}createDevices(e){let t=0;return e.map((e=>{const{serialNumber:r}=e;let i=null==r||""===r?"bootloader":r;return"bootloader"===i&&(t++,i+=t),{path:i,device:e}}))}deviceIsHid(e){return e.vendorId===h.T1_HID_VENDOR}filterDevices(e){const t=e.filter((e=>h.TREZOR_USB_DESCRIPTORS.some((t=>e.vendorId===t.vendorId&&e.productId===t.productId))));return[t.filter((e=>this.deviceIsHid(e))),t.filter((e=>!this.deviceIsHid(e)))]}}t.UsbInterface=f},"../transport/lib/sessions/background-browser.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.initBackgroundInBrowser=void 0;const s=r("../transport/lib/sessions/background.js"),o=n(r("../transport/lib/sessions/background-sharedworker.js"));t.initBackgroundInBrowser=()=>{try{const e=new o.default,t=t=>new i((r=>{const i=n=>{t.id===n.data.id&&(r(n.data),e.port.removeEventListener("message",i))};e.port.addEventListener("message",i),e.port.onmessageerror=t=>{console.error("background-browser onmessageerror,",t),e.port.removeEventListener("message",i)},e.port.postMessage(t)})),r=t=>{e.port.addEventListener("message",(e=>{"type"in(null==e?void 0:e.data)&&"descriptors"===e.data.type&&t(e.data.payload)}))};return{background:e,requestFn:t,registerBackgroundCallbacks:r}}catch(e){console.warn("Unable to load background-sharedworker. Falling back to use local module. Say bye bye to tabs synchronization");const t=new s.SessionsBackground,r=e=>{t.on("descriptors",(t=>{e(t)}))};return{background:t,requestFn:t.handleMessage.bind(t),registerBackgroundCallbacks:r}}}},"../transport/lib/sessions/background.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=i))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SessionsBackground=void 0;const u=r("../utils/lib/index.js"),h=r("../utils/lib/typedEventEmitter.js"),l=o(r("../transport/lib/errors.js"));class d extends h.TypedEmitter{constructor(){super(...arguments),this.sessions={},this.locksQueue=[],this.locksTimeoutQueue=[],this.lastSession=0}handleMessage(e){return a(this,void 0,void 0,(function*(){let t;try{switch(e.type){case"handshake":t=this.handshake();break;case"enumerateIntent":t=yield this.enumerateIntent();break;case"enumerateDone":t=yield this.enumerateDone(e.payload);break;case"acquireIntent":t=yield this.acquireIntent(e.payload);break;case"acquireDone":t=yield this.acquireDone(e.payload);break;case"getSessions":t=yield this.getSessions();break;case"releaseIntent":t=yield this.releaseIntent(e.payload);break;case"releaseDone":t=yield this.releaseDone(e.payload);break;case"getPathBySession":t=this.getPathBySession(e.payload);break;default:throw new Error(l.UNEXPECTED_ERROR)}return Object.assign(Object.assign({},t),{id:e.id})}catch(t){return Object.assign(Object.assign({},this.error(l.UNEXPECTED_ERROR)),{id:e.type})}finally{if(t&&t.success&&t.payload&&"descriptors"in t.payload){const{descriptors:e}=t.payload;setTimeout((()=>this.emit("descriptors",e)),0)}}}))}handshake(){return this.success(void 0)}enumerateIntent(){return a(this,void 0,void 0,(function*(){return yield this.waitInQueue(),this.success({sessions:this.sessions})}))}enumerateDone(e){this.clearLock();this.filterDisconnectedDevices(this.sessionsToDescriptors(),e.paths).forEach((e=>{delete this.sessions[e.path]})),e.paths.forEach((e=>{this.sessions[e]||(this.sessions[e]=null)}));const t=this.sessionsToDescriptors();return i.resolve(this.success({sessions:this.sessions,descriptors:t}))}acquireIntent(e){return a(this,void 0,void 0,(function*(){const t=this.sessions[e.path];if(e.previous&&e.previous!==t)return this.error(l.SESSION_WRONG_PREVIOUS);if(yield this.waitInQueue(),t!==this.sessions[e.path])return this.clearLock(),this.error(l.SESSION_WRONG_PREVIOUS);const r=JSON.parse(JSON.stringify(this.sessions)),i=`${this.getNewSessionId()}`;r[e.path]=i;const n=this.sessionsToDescriptors(r);return this.success({session:i,descriptors:n})}))}acquireDone(e){this.clearLock(),this.sessions[e.path]=`${this.lastSession}`;const t=this.sessionsToDescriptors();return i.resolve(this.success({descriptors:t}))}releaseIntent(e){return a(this,void 0,void 0,(function*(){const t=this._getPathBySession({session:e.session});return t?(yield this.waitInQueue(),this.success({path:t})):this.error(l.SESSION_NOT_FOUND)}))}releaseDone(e){this.sessions[e.path]=null,this.clearLock();const t=this.sessionsToDescriptors();return i.resolve(this.success({descriptors:t}))}getSessions(){return i.resolve(this.success({sessions:this.sessions}))}getPathBySession({session:e}){const t=this._getPathBySession({session:e});return t?this.success({path:t}):this.error(l.SESSION_NOT_FOUND)}_getPathBySession({session:e}){let t;return Object.keys(this.sessions).forEach((r=>{this.sessions[r]===e&&(t=r)})),t}startLock(){const e=(0,u.createDeferred)(),t=setTimeout((()=>{e.resolve(void 0)}),4e3);return this.locksQueue.push(e),this.locksTimeoutQueue.push(t),this.locksQueue.length-1}clearLock(){this.locksQueue[0]?(this.locksQueue[0].resolve(void 0),this.locksQueue.shift(),clearTimeout(this.locksTimeoutQueue[0]),this.locksTimeoutQueue.shift()):console.warn("empty lock queue")}waitForUnlocked(e){return a(this,void 0,void 0,(function*(){if(e>0){const t=this.locksQueue.slice(0,e);t.length&&(yield i.all(t.map((e=>e.promise))))}}))}waitInQueue(){return a(this,void 0,void 0,(function*(){const e=this.startLock();yield this.waitForUnlocked(e)}))}getNewSessionId(){return this.lastSession++,this.lastSession}sessionsToDescriptors(e){return Object.entries(e||this.sessions).map((e=>({path:e[0],session:e[1]})))}filterDisconnectedDevices(e,t){return e.filter((e=>!t.find((t=>e.path===t))))}success(e){return{success:!0,payload:e}}error(e){return{success:!1,error:e}}}t.SessionsBackground=d},"../transport/lib/sessions/client.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionsClient=void 0;const i=r("../utils/lib/index.js"),n=r("../utils/lib/typedEventEmitter.js");class s extends n.TypedEmitter{constructor({requestFn:e,registerBackgroundCallbacks:t}){super(),this.caller=(0,i.getWeakRandomId)(3),this.id=0,this.request=t=>(t.caller=this.caller,t.id=this.id,this.id++,e(t)),t&&t((e=>{this.emit("descriptors",e)}))}handshake(){return this.request({type:"handshake"})}enumerateIntent(){return this.request({type:"enumerateIntent"})}enumerateDone(e){return this.request({type:"enumerateDone",payload:e})}acquireIntent(e){return this.request({type:"acquireIntent",payload:e})}acquireDone(e){return this.request({type:"acquireDone",payload:e})}releaseIntent(e){return this.request({type:"releaseIntent",payload:e})}releaseDone(e){return this.request({type:"releaseDone",payload:e})}getSessions(){return this.request({type:"getSessions"})}getPathBySession(e){return this.request({type:"getPathBySession",payload:e})}}t.SessionsClient=s},"../transport/lib/transports/abstract.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTransport=void 0;const o=s(r("../../node_modules/protobufjs/light.js")),a=r("../utils/lib/index.js"),u=r("../utils/lib/typedEventEmitter.js"),h=r("../transport/lib/utils/result.js"),l=s(r("../transport/lib/errors.js")),d=r("../transport/lib/constants.js");class c extends u.TypedEmitter{constructor({messages:e,signal:t,logger:r}){if(super(),this.isOutdated=!1,this.version="",this.stopped=!1,this.listening=!1,this.acquiredUnconfirmed={},this.listenPromise={},this.unknownError=(e,t)=>(this.logger.error(this.name,"unexpected error: ",e),(0,h.unknownError)("string"!=typeof e?e:new Error(e),t)),this.createLocalAbortController=()=>{const e=new AbortController,t=()=>e.abort();return e.signal.addEventListener("abort",(()=>{this.abortController.signal.removeEventListener("abort",t)})),this.abortController.signal.addEventListener("abort",t),{signal:e.signal,abort:t}},this.scheduleAction=(e,t,r)=>{const{signal:i,abort:n}=this.createLocalAbortController();return{promise:(0,a.scheduleAction)(e,Object.assign({signal:i,timeout:d.ACTION_TIMEOUT},t)).catch((e=>{const t=[l.ABORTED_BY_TIMEOUT,l.ABORTED_BY_SIGNAL];return r&&t.push(...r),(0,h.unknownError)(e,t)})).finally((()=>{this.abortController.signal.removeEventListener("abort",n)})),abort:n}},this.descriptors=[],this.messages=o.Root.fromJSON(e),this.abortController=new AbortController,t){const e=()=>this.abortController.abort();this.abortController.signal.addEventListener("abort",(()=>t.removeEventListener("abort",e))),t.addEventListener("abort",e)}this.logger=r||{debug:(...e)=>{},log:(...e)=>{},warn:(...e)=>{},error:(...e)=>{}}}_getDiff(e){const t=e.filter((e=>!this.descriptors.find((t=>t.path===e.path)))),r=this.descriptors.filter((t=>void 0===e.find((e=>e.path===t.path)))),i=e.filter((e=>{const t=this.descriptors.find((t=>t.path===e.path));return!!t&&t.session!==e.session})),n=i.filter((e=>"string"==typeof e.session)),s=n.filter((e=>e.session===this.acquiredUnconfirmed[e.path])),o=n.filter((e=>e.session!==this.acquiredUnconfirmed[e.path])),a=i.filter((e=>"string"!=typeof e.session)),u=a.filter((e=>{var t;return(null===(t=this.descriptors.find((t=>t.path===e.path)))||void 0===t?void 0:t.session)===this.releasingSession})),h=a.filter((e=>{var t;return(null===(t=this.descriptors.find((t=>t.path===e.path)))||void 0===t?void 0:t.session)!==this.releasingSession}));return{connected:t,disconnected:r,changedSessions:i,acquired:n,acquiredByMyself:s,acquiredElsewhere:o,released:a,releasedByMyself:u,releasedElsewhere:h,didUpdate:t.length+r.length+i.length>0,descriptors:e}}handleDescriptorsChange(e){if(this.stopped)return;const t=this._getDiff(e);this.logger.debug("nextDescriptors",e,"diff",t),t.didUpdate&&(this.descriptors=e,Object.keys(this.listenPromise).forEach((t=>{const r=e.find((e=>e.path===t));if(!r)return this.listenPromise[t].resolve(this.error({error:l.DEVICE_DISCONNECTED_DURING_ACTION}));if(this.acquiredUnconfirmed[t]){r.session===this.acquiredUnconfirmed[t]?this.listenPromise[t].resolve(this.success(this.acquiredUnconfirmed[t])):this.listenPromise[t].resolve(this.error({error:l.SESSION_WRONG_PREVIOUS})),delete this.acquiredUnconfirmed[t]}else this.releasingSession?this.listenPromise[t].resolve(this.success("null")):this.listenPromise[t].resolve(this.error({error:l.SESSION_WRONG_PREVIOUS}))})),this.emit(d.TRANSPORT.UPDATE,t),this.releasingSession=void 0)}success(e){return(0,h.success)(e)}error(e){return(0,h.error)(e)}}t.AbstractTransport=c},"../transport/lib/transports/abstractUsb.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=i))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractUsbTransport=void 0;const u=r("../utils/lib/index.js"),h=r("../transport/lib/transports/abstract.js"),l=r("../transport/lib/utils/send.js"),d=r("../transport/lib/utils/receive.js"),c=o(r("../transport/lib/errors.js"));class f extends h.AbstractTransport{constructor({messages:e,usbInterface:t,sessionsClient:r,signal:i}){super({messages:e,signal:i}),this.sessionsClient=r,this.transportInterface=t}init(){return this.scheduleAction((()=>a(this,void 0,void 0,(function*(){return(yield this.sessionsClient.handshake()).success?this.success(void 0):this.unknownError("handshake error",[])}))))}listen(){return this.listening?this.error({error:c.ALREADY_LISTENING}):(this.listening=!0,this.transportInterface.on("transport-interface-change",(e=>{this.sessionsClient.enumerateDone({paths:e})})),this.sessionsClient.on("descriptors",(e=>a(this,void 0,void 0,(function*(){var t;(null===(t=this.acquirePromise)||void 0===t?void 0:t.promise)&&(yield this.acquirePromise.promise),this.handleDescriptorsChange(e)})))),this.success(void 0))}enumerate(){return this.scheduleAction((()=>a(this,void 0,void 0,(function*(){yield this.sessionsClient.enumerateIntent();const e=yield this.transportInterface.enumerate();if(!e.success)return e;const t=e.payload,r=yield this.sessionsClient.enumerateDone({paths:t});return this.success(r.payload.descriptors)}))))}acquire({input:e}){return this.scheduleAction((()=>a(this,void 0,void 0,(function*(){const{path:t}=e;this.listening&&(this.listenPromise[t]=(0,u.createDeferred)()),this.acquirePromise=(0,u.createDeferred)();const r=yield this.sessionsClient.acquireIntent(e);if(this.acquirePromise&&this.acquirePromise.resolve(void 0),!r.success)return this.error({error:r.error});this.acquiredUnconfirmed[t]=r.payload.session;const i=!!e.previous,n=yield this.transportInterface.openDevice(t,i);return n.success?(this.sessionsClient.acquireDone({path:t}),this.listenPromise[t]?this.listenPromise[t].promise.finally((()=>{delete this.listenPromise[t]})):this.success(r.payload.session)):(this.listenPromise&&this.listenPromise[t].resolve(n),n)}))),void 0,[c.DEVICE_DISCONNECTED_DURING_ACTION,c.SESSION_WRONG_PREVIOUS])}release({path:e,session:t,onClose:r}){return this.scheduleAction((()=>a(this,void 0,void 0,(function*(){this.listening&&(this.releasingSession=t,this.listenPromise[e]=(0,u.createDeferred)());const i=yield this.sessionsClient.releaseIntent({session:t});if(!i.success)return this.error({error:i.error});const n=this.releaseDevice(i.payload.path);return r?this.success(void 0):(yield n,yield this.sessionsClient.releaseDone({path:i.payload.path}),this.listenPromise[e]?this.listenPromise[e].promise.then((()=>this.success(void 0))).finally((()=>{delete this.listenPromise[e]})):this.success(void 0))}))))}call({session:e,name:t,data:r}){return this.scheduleAction((()=>a(this,void 0,void 0,(function*(){const i=yield this.sessionsClient.getPathBySession({session:e});if(!i.success)return"session not found"===i.error?this.error({error:c.DEVICE_DISCONNECTED_DURING_ACTION}):this.error({error:c.UNEXPECTED_ERROR});const{path:n}=i.payload;try{yield(0,l.buildAndSend)(this.messages,(e=>this.transportInterface.write(n,e).then((e=>{if(!e.success)throw new Error(e.error)}))),t,r);const e=yield(0,d.receiveAndParse)(this.messages,(()=>this.transportInterface.read(n).then((e=>{if(e.success)return e.payload;throw new Error(e.error)}))));return this.success(e)}catch(e){return e.message===c.DEVICE_DISCONNECTED_DURING_ACTION&&this.enumerate(),this.unknownError(e,[c.DEVICE_DISCONNECTED_DURING_ACTION,c.DEVICE_NOT_FOUND,c.INTERFACE_UNABLE_TO_OPEN_DEVICE,c.INTERFACE_DATA_TRANSFER])}}))),{timeout:void 0})}send({data:e,session:t,name:r}){return this.scheduleAction((()=>a(this,void 0,void 0,(function*(){const i=yield this.sessionsClient.getPathBySession({session:t});if(!i.success)return this.error({error:i.error});const{path:n}=i.payload;try{return yield(0,l.buildAndSend)(this.messages,(e=>this.transportInterface.write(n,e).then((e=>{if(!e.success)throw new Error(e.error)}))),r,e),this.success(void 0)}catch(e){return e.message===c.DEVICE_DISCONNECTED_DURING_ACTION&&this.enumerate(),this.unknownError(e,[c.DEVICE_DISCONNECTED_DURING_ACTION])}}))))}receive({session:e}){return this.scheduleAction((()=>a(this,void 0,void 0,(function*(){const t=yield this.sessionsClient.getPathBySession({session:e});if(!t.success)return this.error({error:t.error});const{path:r}=t.payload;try{const e=yield(0,d.receiveAndParse)(this.messages,(()=>this.transportInterface.read(r).then((e=>{if(!e.success)throw new Error(e.error);return e.payload}))));return this.success(e)}catch(e){return e.message===c.DEVICE_DISCONNECTED_DURING_ACTION&&this.enumerate(),this.unknownError(e,[c.DEVICE_DISCONNECTED_DURING_ACTION])}}))))}releaseDevice(e){return this.transportInterface.closeDevice(e)}stop(){this.transportInterface.on("transport-interface-change",(()=>{this.logger.debug("device connected after transport stopped")})),this.stopped=!0,this.abortController.abort()}}t.AbstractUsbTransport=f},"../transport/lib/transports/bridge.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=i))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))},u=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);na(this,void 0,void 0,(function*(){const t=yield this._post("/",{signal:e});return t.success?(this.version=t.payload.version,this.latestVersion&&(this.isOutdated=h.versionUtils.isNewer(this.latestVersion,this.version)),this.success(void 0)):t}))))}listen(){return this.listening?this.error({error:b.ALREADY_LISTENING}):(this.listening=!0,this._listen(),this.success(void 0))}_listen(){return a(this,void 0,void 0,(function*(){if(this.stopped)return;const e=(new Date).getTime(),t=yield this._post("/listen",{body:this.descriptors,signal:this.abortController.signal});if(!t.success){return(new Date).getTime()-e>1100?(yield(0,h.createTimeoutPromise)(1e3),this._listen()):void this.emit("transport-error",t.error)}return this.acquirePromise&&(yield this.acquirePromise.promise),this.handleDescriptorsChange(t.payload),this._listen()}))}enumerate(){return this.scheduleAction((e=>this._post("/enumerate",{signal:e})))}acquire({input:e}){return this.scheduleAction((t=>a(this,void 0,void 0,(function*(){const r=null==e.previous?"null":e.previous;this.listening&&(this.listenPromise[e.path]=(0,h.createDeferred)()),this.acquirePromise=(0,h.createDeferred)();const i=yield this._post("/acquire",{params:`${e.path}/${r}`,timeout:!0,signal:t});return this.acquirePromise.resolve(void 0),i.success?(this.acquiredUnconfirmed[e.path]=i.payload,this.listenPromise[e.path]?this.listenPromise[e.path].promise.finally((()=>{delete this.listenPromise[e.path]})):this.success(i.payload)):i}))),void 0,[b.DEVICE_DISCONNECTED_DURING_ACTION,b.SESSION_WRONG_PREVIOUS])}release({path:e,session:t,onClose:r}){return this.scheduleAction((n=>{this.listening&&!r&&(this.releasingSession=t,this.listenPromise[e]=(0,h.createDeferred)());const s=this._post("/release",{params:t,signal:n});return r?i.resolve(this.success(void 0)):this.listenPromise[e]?this.listenPromise[e].promise.then((()=>this.success(void 0))).finally((()=>{delete this.listenPromise[e]})):s}))}releaseDevice(){return i.resolve(this.success(void 0))}call({session:e,name:t,data:r}){return this.scheduleAction((i=>a(this,void 0,void 0,(function*(){const{messages:n}=this,s=(0,f.buildOne)(n,t,r).toString("hex"),o=yield this._post("/call",{params:e,body:s,signal:i});if(!o.success)return o;const a=(0,p.receiveOne)(this.messages,o.payload);return this.success(a)}))),{timeout:void 0})}send({session:e,name:t,data:r}){return this.scheduleAction((i=>a(this,void 0,void 0,(function*(){const{messages:n}=this,s=(0,f.buildOne)(n,t,r).toString("hex"),o=yield this._post("/post",{params:e,body:s,signal:i});return o.success?this.success(void 0):o}))))}receive({session:e}){return this.scheduleAction((t=>a(this,void 0,void 0,(function*(){const r=yield this._post("/read",{params:e,signal:t});if(!r.success)return r;const i=(0,p.receiveOne)(this.messages,r.payload);return this.success(i)}))))}stop(){this.stopped=!0,this.listening=!1,this.abortController.abort()}_post(e,t){return a(this,void 0,void 0,(function*(){const{timeout:r,signal:i}=t,n=u(t,["timeout","signal"]),s=yield(0,d.bridgeApiCall)(Object.assign(Object.assign({},n),{method:"POST",url:`${this.url+e}${(null==t?void 0:t.params)?`/${t.params}`:""}`,skipContentTypeHeader:!0}));if(!s.success){if(s.error===b.UNEXPECTED_ERROR)return s;if(s.error===b.HTTP_ERROR)return this.error({error:s.error});switch(e){case"/":case"/enumerate":case"/listen":return this.unknownError(s.error,[]);case"/acquire":return this.unknownError(s.error,[b.SESSION_WRONG_PREVIOUS,b.DEVICE_NOT_FOUND,b.INTERFACE_UNABLE_TO_OPEN_DEVICE,b.DEVICE_DISCONNECTED_DURING_ACTION]);case"/read":case"/call":case"/post":return this.unknownError(s.error,[b.SESSION_NOT_FOUND,b.DEVICE_DISCONNECTED_DURING_ACTION,b.OTHER_CALL_IN_PROGRESS,l.PROTOCOL_MALFORMED]);case"/release":return this.unknownError(s.error,[b.SESSION_NOT_FOUND,b.DEVICE_DISCONNECTED_DURING_ACTION]);default:return this.error({error:b.WRONG_RESULT_TYPE,message:"just for type safety, should never happen"})}}switch(e){case"/":return c.info(s.payload);case"/acquire":return c.acquire(s.payload);case"/read":case"/call":return c.call(s.payload);case"/enumerate":case"/listen":return c.devices(s.payload);case"/post":case"/release":return c.empty(s.payload);default:return this.error({error:b.WRONG_RESULT_TYPE,message:"just for type safety, should never happen"})}}))}}t.BridgeTransport=y},"../transport/lib/transports/nodeusb.browser.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeUsbTransport=void 0;const i=r("../transport/lib/transports/abstract.js"),n=r("../transport/lib/errors.js"),s=r("../transport/lib/utils/resultEmpty.js");class o extends i.AbstractTransport{constructor(e){super(e),this.name="NodeUsbTransport",this.init=s.emptyAbortable,this.acquire=s.emptyAbortable,this.enumerate=s.emptyAbortable,this.call=s.emptyAbortable,this.receive=s.emptyAbortable,this.send=s.emptyAbortable,this.release=s.emptyAbortable,this.stop=s.empty,this.releaseDevice=s.empty,this.listen=s.emptySync,console.error(n.WRONG_ENVIRONMENT)}}t.NodeUsbTransport=o},"../transport/lib/transports/udp.browser.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.UdpTransport=void 0;const n=r("../transport/lib/transports/abstract.js"),s=r("../transport/lib/utils/result.js"),o=r("../transport/lib/errors.js"),a=()=>({promise:i.resolve((0,s.error)({error:o.WRONG_ENVIRONMENT})),abort:()=>{}}),u=()=>i.resolve((0,s.error)({error:o.WRONG_ENVIRONMENT})),h=()=>(0,s.error)({error:o.WRONG_ENVIRONMENT});class l extends n.AbstractTransport{constructor(){super(...arguments),this.name="UdpTransport",this.init=a,this.acquire=a,this.enumerate=a,this.call=a,this.receive=a,this.send=a,this.release=a,this.stop=u,this.releaseDevice=u,this.listen=h}}t.UdpTransport=l},"../transport/lib/transports/webusb.browser.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebUsbTransport=void 0;const i=r("../transport/lib/transports/abstractUsb.js"),n=r("../transport/lib/sessions/client.js"),s=r("../transport/lib/interfaces/usb.js"),o=r("../transport/lib/sessions/background-browser.js");class a extends i.AbstractUsbTransport{constructor({messages:e,logger:t}){const{requestFn:r,registerBackgroundCallbacks:i}=(0,o.initBackgroundInBrowser)();super({messages:e,usbInterface:new s.UsbInterface({usbInterface:navigator.usb,logger:t}),sessionsClient:new n.SessionsClient({requestFn:r,registerBackgroundCallbacks:i})}),this.name="WebUsbTransport"}}t.WebUsbTransport=a},"../transport/lib/utils/bridgeApiCall.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=i))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.bridgeApiCall=void 0;const h=u(r("../../node_modules/cross-fetch/dist/browser-ponyfill.js")),l=r("../transport/lib/utils/result.js"),d=o(r("../transport/lib/errors.js")),c=r("../protocol/lib/index.js"),f="undefined"==typeof window;function p(e){return"string"==typeof e?""===e?"text/plain":"application/octet-stream":"application/json"}t.bridgeApiCall=function(e){return a(this,void 0,void 0,(function*(){const t={method:e.method,body:(r=e.body,"string"==typeof r?r:JSON.stringify(r)),credentials:"same-origin",headers:{},signal:e.signal,timeout:e.timeout};var r;let i,n;null!=e.skipContentTypeHeader&&!1!==e.skipContentTypeHeader||(t.headers=Object.assign(Object.assign({},t.headers),{"Content-Type":p(null==e.body?"":e.body)})),f&&(t.headers=Object.assign(Object.assign({},t.headers),{Origin:"https://node.trezor.io"}));try{i=yield(0,h.default)(e.url,t)}catch(e){return(0,l.error)({error:d.HTTP_ERROR,message:e.message})}try{n=yield i.text(),n=function(e){try{return JSON.parse(e)}catch(t){return e}}(n)}catch(e){return(0,l.error)({error:d.HTTP_ERROR,message:e.message})}if(!i.ok){const e="string"!=typeof n&&"error"in n?n.error:n;return"closed device"===e?(0,l.error)({error:d.INTERFACE_UNABLE_TO_OPEN_DEVICE}):"malformed protobuf"===e||"malformed wire format"===e?(0,l.error)({error:c.PROTOCOL_MALFORMED}):(0,l.unknownError)(new Error(e),[d.DEVICE_NOT_FOUND,d.HTTP_ERROR,d.DEVICE_DISCONNECTED_DURING_ACTION,d.OTHER_CALL_IN_PROGRESS,d.SESSION_NOT_FOUND,d.SESSION_WRONG_PREVIOUS])}return(0,l.success)(n)}))}},"../transport/lib/utils/bridgeApiResult.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.call=t.acquire=t.devices=t.version=t.info=void 0;const o=r("../transport/lib/utils/result.js"),a=s(r("../transport/lib/errors.js"));function u(e){return"string"==typeof e}t.info=function(e){if(u(e))return(0,o.error)({error:a.WRONG_RESULT_TYPE});const{version:t}=e;if("string"!=typeof t)return(0,o.error)({error:a.WRONG_RESULT_TYPE});const r=!!e.configured;return(0,o.success)({version:t,configured:r})},t.version=function(e){return u(e)?(0,o.success)(e.trim()):(0,o.error)({error:a.WRONG_RESULT_TYPE})},t.devices=function(e){return u(e)?(0,o.error)({error:a.WRONG_RESULT_TYPE}):e instanceof Array?e.some((e=>"object"!=typeof e||!e||"string"!=typeof e.path||"string"!=typeof e.session&&null!==e.session))?(0,o.error)({error:a.WRONG_RESULT_TYPE}):(0,o.success)(e.map((e=>({path:e.path,session:e.session,product:e.product,vendor:e.vendor,debug:e.debug,debugSession:e.debugSession})))):(0,o.error)({error:a.WRONG_RESULT_TYPE})},t.acquire=function(e){if(u(e))return(0,o.error)({error:a.WRONG_RESULT_TYPE});const{session:t}=e;return"string"!=typeof t?(0,o.error)({error:a.WRONG_RESULT_TYPE}):(0,o.success)(t)},t.call=function(e){return u(e)?(0,o.success)(e):(0,o.error)({error:a.WRONG_RESULT_TYPE})},t.empty=function(e){return null!=e&&"{}"===JSON.stringify(e)?(0,o.error)({error:a.WRONG_RESULT_TYPE}):(0,o.success)(void 0)}},"../transport/lib/utils/receive.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=i))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.receiveAndParse=t.receiveOne=void 0;const o=s(r("../../node_modules/bytebuffer/dist/bytebuffer.js")),a=r("../protobuf/lib/index.js"),u=r("../protocol/lib/index.js");function h(e,t,r){return n(this,void 0,void 0,(function*(){if(e.offset>=r)return;const i=yield t();if(null==i)throw new Error("Received no data.");return e.append(i.slice(1)),h(e,t,r)}))}function l(e){return n(this,void 0,void 0,(function*(){const t=yield e(),{length:r,typeId:i,restBuffer:n}=u.v1.decodeChunked(t),s=new o.default(r);return r&&s.append(n),yield h(s,e,r),{received:s,typeId:i}}))}t.receiveOne=function(e,t){const r=o.default.wrap(t,"hex"),{typeId:i,buffer:n}=u.bridge.decode(r),{Message:s,messageName:h}=(0,a.createMessageFromType)(e,i);return{message:(0,a.decode)(s,n),type:h}},t.receiveAndParse=function(e,t){return n(this,void 0,void 0,(function*(){const{received:r,typeId:i}=yield l(t),{Message:n,messageName:s}=(0,a.createMessageFromType)(e,i);r.reset();return{message:(0,a.decode)(n,r),type:s}}))}},"../transport/lib/utils/result.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unknownError=t.error=t.success=void 0;const i=r("../transport/lib/errors.js");t.success=e=>({success:!0,payload:e});t.error=({error:e,message:t})=>({success:!1,error:e,message:t});t.unknownError=(e,r)=>{const n=r.find((t=>t===e.message));return n?(0,t.error)({error:n}):{success:!1,error:i.UNEXPECTED_ERROR,message:e.message}}},"../transport/lib/utils/resultEmpty.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.emptySync=t.empty=t.emptyAbortable=void 0;const n=r("../transport/lib/errors.js"),s=r("../transport/lib/utils/result.js");t.emptyAbortable=()=>({promise:i.resolve((0,s.error)({error:n.WRONG_ENVIRONMENT})),abort:()=>{}});t.empty=()=>i.resolve((0,s.error)({error:n.WRONG_ENVIRONMENT}));t.emptySync=()=>(0,s.error)({error:n.WRONG_ENVIRONMENT})},"../transport/lib/utils/send.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=i))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.buildAndSend=t.buildBuffers=t.buildOne=void 0;const s=r("../protobuf/lib/index.js"),o=r("../protocol/lib/index.js");t.buildOne=function(e,t,r){const{Message:i,messageType:n}=(0,s.createMessageFromName)(e,t),a=(0,s.encode)(i,r);return o.bridge.encode(a,{messageType:n})};t.buildBuffers=(e,t,r)=>{const{Message:i,messageType:n}=(0,s.createMessageFromName)(e,t),a=(0,s.encode)(i,r);return o.v1.encode(a,{messageType:n})},t.buildAndSend=function(e,r,i,s){return function(e,t){return n(this,void 0,void 0,(function*(){for(const r of t)yield e(r)}))}(r,(0,t.buildBuffers)(e,i,s))}},"../utils/lib/arrayDistinct.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayDistinct=void 0;t.arrayDistinct=(e,t,r)=>r.indexOf(e)===t},"../utils/lib/arrayPartition.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayPartition=void 0;t.arrayPartition=(e,t)=>e.reduce((([e,r],i)=>t(i)?[[...e,i],r]:[e,[...r,i]]),[[],[]])},"../utils/lib/arrayShuffle.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayShuffle=void 0;t.arrayShuffle=e=>{const t=e.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1));[t[e],t[r]]=[t[r],t[e]]}return t}},"../utils/lib/arrayToDictionary.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayToDictionary=void 0;const r=e=>!!["string","number"].includes(typeof e);t.arrayToDictionary=(e,t,i)=>i?e.reduce(((e,i)=>{var n;const s=t(i);return r(s)?Object.assign(Object.assign({},e),{[s]:[...null!==(n=e[s])&&void 0!==n?n:[],i]}):e}),{}):e.reduce(((e,i)=>{const n=t(i);return r(n)?Object.assign(Object.assign({},e),{[n]:i}):e}),{})},"../utils/lib/bufferUtils.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.getChunkSize=t.reverseBuffer=void 0;t.reverseBuffer=e=>{if(e.length<1)return e;const t=Buffer.alloc(e.length);let r=t.length-1;for(let i=0;i{const t=Buffer.allocUnsafe(1);return t.writeUInt8(e),t}},"../utils/lib/bytesToHumanReadable.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bytesToHumanReadable=void 0;const r=["B","KB","MB","GB","TB"];t.bytesToHumanReadable=e=>{let t=Math.abs(e),i=0;for(;t>=1024||i>=r.length;)t/=1024,i++;return`${t.toFixed(1)} ${r[i]}`}},"../utils/lib/capitalizeFirstLetter.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.capitalizeFirstLetter=void 0;t.capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1)},"../utils/lib/cloneObject.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneObject=void 0;t.cloneObject=e=>{const t=JSON.stringify(e);return void 0===t?e:JSON.parse(t)}},"../utils/lib/countBytesInString.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.countBytesInString=void 0;t.countBytesInString=e=>encodeURI(e).split(/%..|./).length-1},"../utils/lib/createCooldown.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCooldown=void 0;t.createCooldown=e=>{let t=0;return()=>{const r=Date.now();return r-t>=e&&(t=r,!0)}}},"../utils/lib/createDeferred.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferred=void 0;t.createDeferred=e=>{let t=()=>{},r=()=>{};const n=new i(((e,i)=>{t=e,r=i}));return{id:e,resolve:t,reject:r,promise:n}}},"../utils/lib/createTimeoutPromise.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.createTimeoutPromise=void 0;t.createTimeoutPromise=e=>new i((t=>setTimeout(t,e)))},"../utils/lib/enumUtils.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getValueByKey=t.getKeyByValue=void 0,t.getKeyByValue=function(e,t){return e&&Object.keys(e).find((r=>e[r]===t))},t.getValueByKey=function(e,t){const r=e&&Object.keys(e).find((e=>e===t));return r&&e[r]}},"../utils/lib/getLocaleSeparators.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLocaleSeparators=void 0;t.getLocaleSeparators=e=>{var t,r;const i=new Intl.NumberFormat(e).formatToParts(10000.1);return{decimalSeparator:null===(t=i.find((({type:e})=>"decimal"===e)))||void 0===t?void 0:t.value,thousandsSeparator:null===(r=i.find((({type:e})=>"group"===e)))||void 0===r?void 0:r.value}}},"../utils/lib/getNumberFromPixelString.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNumberFromPixelString=void 0;t.getNumberFromPixelString=e=>parseInt(e.replace("px",""),10)},"../utils/lib/getRandomNumberInRange.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRandomNumberInRange=void 0;t.getRandomNumberInRange=(e,t)=>Math.floor(Math.random()*(t-e+1))+e},"../utils/lib/getSynchronize.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.getSynchronize=void 0;t.getSynchronize=()=>{let e;return t=>{const r=(null!=e?e:i.resolve()).catch((()=>{})).then(t).finally((()=>{e===r&&(e=void 0)}));return e=r,e}}},"../utils/lib/getWeakRandomId.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWeakRandomId=void 0;t.getWeakRandomId=e=>{let t="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasUppercaseLetter=void 0;const r=new RegExp("^(.*[A-Z].*)$");t.hasUppercaseLetter=e=>r.test(e)},"../utils/lib/index.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.xssFilters=t.versionUtils=t.enumUtils=t.bufferUtils=void 0,s(r("../utils/lib/arrayDistinct.js"),t),s(r("../utils/lib/arrayPartition.js"),t),s(r("../utils/lib/arrayShuffle.js"),t),s(r("../utils/lib/arrayToDictionary.js"),t),t.bufferUtils=o(r("../utils/lib/bufferUtils.js")),s(r("../utils/lib/bytesToHumanReadable.js"),t),s(r("../utils/lib/capitalizeFirstLetter.js"),t),s(r("../utils/lib/cloneObject.js"),t),s(r("../utils/lib/countBytesInString.js"),t),s(r("../utils/lib/createCooldown.js"),t),s(r("../utils/lib/createDeferred.js"),t),s(r("../utils/lib/createTimeoutPromise.js"),t),t.enumUtils=o(r("../utils/lib/enumUtils.js")),s(r("../utils/lib/getNumberFromPixelString.js"),t),s(r("../utils/lib/getRandomNumberInRange.js"),t),s(r("../utils/lib/getSynchronize.js"),t),s(r("../utils/lib/getWeakRandomId.js"),t),s(r("../utils/lib/hasUppercaseLetter.js"),t),s(r("../utils/lib/isAscii.js"),t),s(r("../utils/lib/isHex.js"),t),s(r("../utils/lib/isNotUndefined.js"),t),s(r("../utils/lib/isUrl.js"),t),s(r("../utils/lib/mergeDeepObject.js"),t),s(r("../utils/lib/objectPartition.js"),t),s(r("../utils/lib/parseElectrumUrl.js"),t),s(r("../utils/lib/parseHostname.js"),t),s(r("../utils/lib/promiseAllSequence.js"),t),s(r("../utils/lib/redactUserPath.js"),t),s(r("../utils/lib/scheduleAction.js"),t),s(r("../utils/lib/throwError.js"),t),s(r("../utils/lib/truncateMiddle.js"),t),s(r("../utils/lib/topologicalSort.js"),t),s(r("../utils/lib/urlToOnion.js"),t),t.versionUtils=o(r("../utils/lib/versionUtils.js")),t.xssFilters=o(r("../utils/lib/xssFilters.js")),s(r("../utils/lib/getLocaleSeparators.js"),t)},"../utils/lib/isAscii.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAscii=void 0,t.isAscii=function(e){return!e||/^[\x00-\x7F]*$/.test(e)}},"../utils/lib/isHex.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHex=void 0;t.isHex=e=>/^(0x|0X)?[0-9A-Fa-f]+$/g.test(e)},"../utils/lib/isNotUndefined.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNotUndefined=void 0;t.isNotUndefined=e=>void 0!==e},"../utils/lib/isUrl.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUrl=void 0;const r=/^(http|ws)s?:\/\/[a-z0-9]([a-z0-9.-]+)?(:[0-9]{1,5})?((\/)?(([a-z0-9-_])+(\/)?)+)$/i;t.isUrl=e=>r.test(e)},"../utils/lib/mergeDeepObject.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeDeepObject=void 0;const r=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1};t.mergeDeepObject=(...e)=>e.reduce(((e,i)=>{if(Array.isArray(i))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(i).forEach((n=>{["__proto__","constructor","prototype"].includes(n)||(Array.isArray(e[n])&&Array.isArray(i[n])?e[n]=t.mergeDeepObject.options.mergeArrays?Array.from(new Set(e[n].concat(i[n]))):i[n]:r(e[n])&&r(i[n])?e[n]=(0,t.mergeDeepObject)(e[n],i[n]):e[n]=i[n])})),e}),{});const i={mergeArrays:!0};t.mergeDeepObject.options=i,t.mergeDeepObject.withOptions=(e,...r)=>{t.mergeDeepObject.options=Object.assign({mergeArrays:!0},e);const n=(0,t.mergeDeepObject)(...r);return t.mergeDeepObject.options=i,n}},"../utils/lib/objectPartition.js":function(e,t){"use strict";var r=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);nt.reduce((([e,t],i)=>{const n=t,s=i,o=n[s],a=r(n,["symbol"==typeof s?s:s+""]);return void 0!==o?[Object.assign(Object.assign({},e),{[i]:o}),a]:[e,t]}),[{},e])},"../utils/lib/parseElectrumUrl.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseElectrumUrl=void 0;const r=/^(?:([a-zA-Z0-9.-]+)|\[([a-f0-9:]+)\]):([0-9]{1,5}):([ts])$/;t.parseElectrumUrl=e=>{var t;const i=e.match(r);if(i)return{host:null!==(t=i[1])&&void 0!==t?t:i[2],port:Number.parseInt(i[3],10),protocol:i[4]}}},"../utils/lib/parseHostname.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseHostname=void 0;const r=/^([a-z0-9.+-]+:\/\/)?([a-z0-9.-]+)([:/][^:/]+)*\/?$/i;t.parseHostname=e=>{var t,i;return null===(i=null===(t=e.match(r))||void 0===t?void 0:t[2])||void 0===i?void 0:i.toLowerCase()}},"../utils/lib/promiseAllSequence.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=i))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.promiseAllSequence=void 0;t.promiseAllSequence=e=>n(void 0,void 0,void 0,(function*(){const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redactUserPathFromString=t.startOfUserPathRegex=void 0,t.startOfUserPathRegex=/([/\\][Uu]sers[/\\]{1,4})([^"^'^[^\]^/^\\]*)/g;t.redactUserPathFromString=e=>e.replace(t.startOfUserPathRegex,"$1[*]")},"../utils/lib/scheduleAction.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=i))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAction=void 0;const s=e=>Array.isArray(e),o=()=>new Error("Aborted by signal"),a=()=>new Error("Aborted by deadline"),u=()=>new Error("Aborted by timeout"),h=(e,t)=>new i(((r,i)=>{if(t.aborted)return i();if(void 0===e)return r();const n=setTimeout(r,e),s=()=>{clearTimeout(n),t.removeEventListener("abort",s),i()};t.addEventListener("abort",s)})),l=(e,t,r)=>new i(((i,n)=>{if(r.aborted)return n();const s=void 0!==e?setTimeout((()=>n(t())),e):void 0,o=()=>{clearTimeout(s),r.removeEventListener("abort",o),n()};r.addEventListener("abort",o)})),d=(e,t)=>new i(((r,i)=>{if(t.aborted)return i();if(null==e?void 0:e.aborted)return i(o());const n=()=>i(o());null==e||e.addEventListener("abort",n);const s=()=>{null==e||e.removeEventListener("abort",n),t.removeEventListener("abort",s),i()};t.addEventListener("abort",s)})),c=(e,t)=>n(void 0,void 0,void 0,(function*(){const r=new AbortController,n=()=>r.abort();t.aborted&&n(),t.addEventListener("abort",n);try{return yield new i((t=>t(e(r.signal))))}finally{t.removeEventListener("abort",n)}}));t.scheduleAction=(e,t)=>n(void 0,void 0,void 0,(function*(){const{signal:r,delay:o,attempts:f,timeout:p,deadline:m,gap:b}=t,g=m&&m-Date.now(),y=s(f)?f.length:null!=f?f:m?1/0:1,v=new AbortController,w=v.signal,_=s(f)?e=>f[e]:()=>({timeout:p,gap:b});try{return yield i.race([d(r,w),l(g,a,w),h(o,w).then((()=>((e,t,r,s)=>n(void 0,void 0,void 0,(function*(){for(let i=0;ie.abort();s.addEventListener("abort",n);try{return yield t(i,e.signal)}catch(e){n(),yield r(i)}finally{s.removeEventListener("abort",n)}}return s.aborted?i.reject():t(e-1,s)})))(y,((t,r)=>i.race([l(_(t).timeout,u,w),c(e,r)])),(e=>{var t;return h(null!==(t=_(e).gap)&&void 0!==t?t:0,w)}),w)))])}finally{v.abort()}}))},"../utils/lib/throwError.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;t.throwError=e=>{throw new Error(e)}},"../utils/lib/topologicalSort.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.topologicalSort=void 0;const i=r("../utils/lib/arrayPartition.js");t.topologicalSort=(e,t,r)=>{const n=[],s=e=>(0,i.arrayPartition)(e,(r=>!e.some((e=>t(e,r)))));let o=e;for(;o.length;){const[e,t]=s(o);if(!e.length)throw new Error("Cycle detected");n.push(...r?e.sort(r):e),o=t}return n}},"../utils/lib/truncateMiddle.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.truncateMiddle=void 0;t.truncateMiddle=(e,t,r)=>{if(e.length<=t+r)return e;return`${e.substring(0,t)}…${e.substring(e.length-r,e.length)}`}},"../utils/lib/typedEventEmitter.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedEmitter=void 0;const i=r("../../node_modules/events/events.js");class n extends i.EventEmitter{listenerCount(e){return super.listenerCount(e)}}t.TypedEmitter=n},"../utils/lib/urlToOnion.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.urlToOnion=void 0;t.urlToOnion=(e,t)=>{var r;const[,i,n,s,o]=null!==(r=e.match(/^(http|ws)s?:\/\/([^:/]+\.)?([^/.]+\.[^/.]+)(\/.*)?$/i))&&void 0!==r?r:[];if(s&&t[s])return`${i}://${null!=n?n:""}${t[s]}${null!=o?o:""}`}},"../utils/lib/versionUtils.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeVersion=t.isNewerOrEqual=t.isEqual=t.isNewer=t.isVersionArray=void 0;t.isVersionArray=e=>{if(!Array.isArray(e))return!1;if(3!==e.length)return!1;for(let t=0;t({major:e[0],minor:e[1],patch:e[2]}),i=e=>{const r=e.split(".").map((e=>Number(e)));if(!(0,t.isVersionArray)(r))throw new Error("version string is in wrong format");return r},n=e=>`${e[0]}.${e[1]}.${e[2]}`;t.isNewer=(e,t)=>{const n=r("string"==typeof e?i(e):e),s=r("string"==typeof t?i(t):t);return n.major-s.major!=0?n.major>s.major:n.minor-s.minor!=0?n.minor>s.minor:n.patch-s.patch!=0&&n.patch>s.patch};t.isEqual=(e,t)=>("string"==typeof e?e:n(e))===("string"==typeof t?t:n(t));t.isNewerOrEqual=(e,r)=>(0,t.isNewer)(e,r)||(0,t.isEqual)(e,r);t.normalizeVersion=e=>e.replace(/\b0+(\d)/g,"$1")},"../utils/lib/xssFilters.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inDoubleQuotes=t.inSingleQuotes=t.inHTML=void 0;const r=/e.replace(r,"<");t.inSingleQuotes=e=>e.replace(i,"'");t.inDoubleQuotes=e=>e.replace(n,""")},"../utxo-lib/lib/address.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toOutputScript=t.getAddressType=t.fromOutputScript=t.toBech32=t.toBase58Check=t.fromBech32=t.fromBase58Check=void 0;const i=r("../../node_modules/bech32/dist/index.js"),n=r("../utxo-lib/lib/bs58check.js"),s=r("../../node_modules/typeforce/index.js"),o=r("../utxo-lib/lib/script/index.js"),a=r("../utxo-lib/lib/payments/index.js"),u=r("../utxo-lib/lib/networks.js"),h=r("../utxo-lib/lib/types/index.js");function l(e,t=u.bitcoin){return n.decodeAddress(e,t)}function d(e){let t,r;try{t=i.bech32.decode(e)}catch(e){}if(t){if([r]=t.words,0!==r)throw new TypeError(`${e} uses wrong encoding`)}else if(t=i.bech32m.decode(e),[r]=t.words,0===r)throw new TypeError(`${e} uses wrong encoding`);const n=i.bech32.fromWords(t.words.slice(1));return{version:r,prefix:t.prefix,data:Buffer.from(n)}}function c(e,t,r){const n=i.bech32.toWords(e);return n.unshift(t),0===t?i.bech32.encode(r,n):i.bech32m.encode(r,n)}t.fromBase58Check=l,t.fromBech32=d,t.toBase58Check=function(e,t,r=u.bitcoin){return s(h.tuple(h.Hash160bit,h.UInt16),[e,t]),n.encodeAddress(e,t,r)},t.toBech32=c;const f=40,p=2,m=16,b=1,g=80;function y(e,t){try{const{hash:r,version:i}=l(e,t);return{success:!0,format:"base58",version:i,hash:r}}catch(r){try{const{data:r,prefix:i,version:n}=d(e);return i===t.bech32?{success:!0,format:"bech32",version:n,hash:r}:{success:!1,error:"bech32-invalid-prefix"}}catch(e){}}return{success:!1,error:"unknown-format"}}function v(e,t,r,i){if("base58"===e){if(t===i.pubKeyHash)return"p2pkh";if(t===i.scriptHash)return"p2sh"}else if("bech32"===e)if(0===t){if(20===r.length)return"p2wpkh";if(32===r.length)return"p2wsh"}else{if(1===t&&32===r.length)return"p2tr";if(t>=b&&t<=m&&r.length>=p&&r.length<=f)return"p2w-unknown"}return"unknown"}t.fromOutputScript=function(e,t=u.bitcoin){try{return a.p2pkh({output:e,network:t}).address}catch(e){}try{return a.p2sh({output:e,network:t}).address}catch(e){}try{return a.p2wpkh({output:e,network:t}).address}catch(e){}try{return a.p2wsh({output:e,network:t}).address}catch(e){}try{return a.p2tr({output:e,network:t}).address}catch(e){}try{return function(e,t=u.bitcoin){const r=e.subarray(2);if(r.lengthf)throw new TypeError("Invalid program length for segwit address");const i=e[0]-g;if(im)throw new TypeError("Invalid version for segwit address");if(e[1]!==r.length)throw new TypeError("Invalid script for segwit address");return c(r,i,t.bech32)}(e,t)}catch(e){}throw new Error(`${o.toASM(e)} has no matching Address`)},t.getAddressType=function(e,t=u.bitcoin){const{success:r,format:i,version:n,hash:s}=y(e,t);return r?v(i,n,s,t):"unknown"},t.toOutputScript=function(e,t=u.bitcoin){const{success:r,format:i,version:n,hash:s,error:h}=y(e,t);if(r){const e=v(i,n,s,t);if("unknown"!==e)return function(e,t,r){switch(e){case"p2pkh":return a.p2pkh({hash:t}).output;case"p2sh":return a.p2sh({hash:t}).output;case"p2wpkh":return a.p2wpkh({hash:t}).output;case"p2wsh":return a.p2wsh({hash:t}).output;case"p2tr":case"p2w-unknown":return o.compile([r+g,t])}}(e,s,n)}else if("bech32-invalid-prefix"===h)throw new Error(`${e} has an invalid prefix`);throw new Error(`${e} has no matching Script`)}},"../utxo-lib/lib/bip32.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.fromSeed=t.fromPublicKey=t.fromPrivateKey=t.fromBase58=void 0;const i=r("../../node_modules/tiny-secp256k1/js.js"),n=r("../../node_modules/wif/index.js"),s=r("../../node_modules/typeforce/index.js"),o=r("../utxo-lib/lib/bs58check.js"),a=r("../utxo-lib/lib/crypto.js"),u=r("../utxo-lib/lib/networks.js"),h=s.BufferN(32),l=s.compile({wif:s.UInt8,bip32:{public:s.UInt32,private:s.UInt32}}),d=2147483648,c=Math.pow(2,31)-1;function f(e){return s.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function p(e){return s.UInt32(e)&&e<=c}function m(e,t,r,n,o,a){if(s({privateKey:h,chainCode:h},{privateKey:e,chainCode:t}),r=r||u.bitcoin,!i.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new g(e,void 0,t,r,n,o,a)}function b(e,t,r,n,o,a){if(s({publicKey:s.BufferN(33),chainCode:h},{publicKey:e,chainCode:t}),r=r||u.bitcoin,!i.isPoint(e))throw new TypeError("Point is not on the curve");return new g(void 0,e,t,r,n,o,a)}class g{constructor(e,t,r,i,n=0,o=0,a=0){this.__D=e,this.__Q=t,this.chainCode=r,this.network=i,this.__DEPTH=n,this.__INDEX=o,this.__PARENT_FINGERPRINT=a,s(l,i),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return void 0===this.__Q&&(this.__Q=i.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return(0,u.isNetworkType)("decred",this.network)?a.hash160blake256(this.publicKey):a.hash160(this.publicKey)}get fingerprint(){return this.identifier.subarray(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return b(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const{network:e}=this,t=this.isNeutered()?e.bip32.public:e.bip32.private,r=Buffer.allocUnsafe(78);return r.writeUInt32BE(t,0),r.writeUInt8(this.depth,4),r.writeUInt32BE(this.parentFingerprint,5),r.writeUInt32BE(this.index,9),this.chainCode.copy(r,13),this.isNeutered()?this.publicKey.copy(r,45):(r.writeUInt8(0,45),this.privateKey.copy(r,46)),o.encode(r,e)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return n.encode(this.network.wif,this.privateKey,!0)}derive(e){s(s.UInt32,e);const t=e>=d,r=Buffer.allocUnsafe(37);if(t){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");r[0]=0,this.privateKey.copy(r,1),r.writeUInt32BE(e,33)}else this.publicKey.copy(r,0),r.writeUInt32BE(e,33);const n=a.hmacSHA512(this.chainCode,r),o=n.subarray(0,32),u=n.subarray(32);if(!i.isPrivate(o))return this.derive(e+1);let h;if(this.isNeutered()){const t=i.pointAddScalar(this.publicKey,o,!0);if(null===t)return this.derive(e+1);h=b(t,u,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{const t=i.privateAdd(this.privateKey,o);if(null==t)return this.derive(e+1);h=m(t,u,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return h}deriveHardened(e){return s(p,e),this.derive(e+d)}derivePath(e){s(f,e);let t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce(((e,t)=>{let r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))}),this)}sign(e,t){if(!this.privateKey)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return i.sign(e,this.privateKey);let r=i.sign(e,this.privateKey);const n=Buffer.alloc(32,0);let s=0;for(;r[0]>127;)s++,n.writeUIntLE(s,0,6),r=i.signWithEntropy(e,this.privateKey,n);return r}verify(e,t){return i.verify(e,this.publicKey,t)}}function y(e,t,r){return m(e,t,r)}t.fromBase58=function(e,t){const r=Buffer.from((0,u.isNetworkType)("decred",t)?o.decodeBlake256Key(e):o.decode(e,t));if(78!==r.length)throw new TypeError("Invalid buffer length");t=t||u.bitcoin;const i=r.readUInt32BE(0);if(i!==t.bip32.private&&i!==t.bip32.public)throw new TypeError("Invalid network version");const n=r[4],s=r.readUInt32BE(5);if(0===n&&0!==s)throw new TypeError("Invalid parent fingerprint");const a=r.readUInt32BE(9);if(0===n&&0!==a)throw new TypeError("Invalid index");const h=r.subarray(13,45);let l;if(i===t.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");l=m(r.subarray(46,78),h,t,n,a,s)}else{l=b(r.subarray(45,78),h,t,n,a,s)}return l},t.fromPrivateKey=y,t.fromPublicKey=function(e,t,r){return b(e,t,r)},t.fromSeed=function(e,t){if(s(s.Buffer,e),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");t=t||u.bitcoin;const r=a.hmacSHA512(Buffer.from("Bitcoin seed","utf8"),e);return y(r.subarray(0,32),r.subarray(32),t)}},"../utxo-lib/lib/bs58check.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.encodeAddress=t.decodeAddress=t.decode=t.encode=t.encodeBlake256=t.decodeBlake256=t.decodeBlake256Key=t.decodeBlake=void 0;const i=r("../utxo-lib/lib/networks.js"),n=r("../../node_modules/bchaddrjs/src/bchaddr.js"),s=r("../../node_modules/bs58/index.js"),o=r("../../node_modules/bs58check/index.js"),a=r("../utxo-lib/lib/crypto.js");function u(e){const t=e.subarray(-4),r=e.subarray(0,-4),i=(0,a.blake256)((0,a.blake256)(r)).subarray(0,4);if(t[0]^i[0]|t[1]^i[1]|t[2]^i[2]|t[3]^i[3])throw new Error("invalid checksum");return r}function h(e){const t=s.decode(e),r=Buffer.from(t);if(26!==r.length)throw new Error(`${e} invalid address length`);let i;try{i=u(r)}catch(t){if(t instanceof Error)throw new Error(`${e} ${t.message}`);throw new Error(`${e} ${t}`)}return i}function l(e){const t=(0,a.blake256)((0,a.blake256)(e)).subarray(0,4);return s.encode(Buffer.concat([e,t]))}function d(e,t=i.bitcoin){return(0,i.isNetworkType)("decred",t)?l(e):o.encode(e)}function c(e,t=i.bitcoin){return(0,i.isNetworkType)("decred",t)?h(e):o.decode(e)}t.decodeBlake=u,t.decodeBlake256Key=function(e){const t=s.decode(e);return u(Buffer.from(t))},t.decodeBlake256=h,t.encodeBlake256=l,t.encode=d,t.decode=c,t.decodeAddress=function(e,t=i.bitcoin){let r;if((0,i.isNetworkType)("bitcoinCash",t)){if(!n.isCashAddress(e))throw Error(`${e} is not a cash address`);r=Buffer.from(o.decode(n.toLegacyAddress(e)))}else r=Buffer.from(c(e,t));if(r.length<21)throw new TypeError(`${e} is too short`);if(r.length>22)throw new TypeError(`${e} is too long`);const s=22===r.length,a=s?2:1;return{version:s?r.readUInt16BE(0):r[0],hash:r.subarray(a)}},t.encodeAddress=function(e,t,r=i.bitcoin){const s=t>255,o=s?22:21,a=s?2:1,u=Buffer.allocUnsafe(o);s?u.writeUInt16BE(t,0):u.writeUInt8(t,0),e.copy(u,a);const h=d(u,r);return(0,i.isNetworkType)("bitcoinCash",r)?n.toCashAddress(h):h}},"../utxo-lib/lib/bufferutils.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.BufferReader=t.BufferWriter=t.getChunkSize=t.reverseBuffer=t.writePushDataInt=t.varIntSize=t.readPushDataInt=t.pushDataSize=t.cloneBuffer=t.writeVarInt=t.readVarInt=t.writeInt64LE=t.writeUInt64LEasString=t.writeUInt64LE=t.readInt64LE=t.readUInt64LEasString=t.readUInt64LE=t.verifuint=void 0;const i=r("../../node_modules/bn.js/lib/bn.js"),n=r("../../node_modules/pushdata-bitcoin/index.js"),s=r("../../node_modules/varuint-bitcoin/index.js"),o=r("../../node_modules/int64-buffer/int64-buffer.js"),a=r("../../node_modules/typeforce/index.js"),u=r("../utils/lib/index.js"),h=r("../utxo-lib/lib/types/index.js");function l(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function d(e,t){const r=e.readUInt32LE(t);let i=e.readUInt32LE(t+4);return i*=4294967296,l(i+r,9007199254740991),i+r}function c(e,t){try{return d(e,t).toString()}catch(r){const n=e.readUInt32LE(t),s=e.readUInt32LE(t+4),o=new i(4294967296),a=new i(n),u=new i(s).mul(o);return a.add(u).toString()}}function f(e,t){const r=e.readUInt32LE(t);let i=e.readInt32LE(t+4);return i*=4294967296,i+r}function p(e,t,r){return l(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}function m(e,t,r){if("string"!=typeof t)return p(e,t,r);return new o.Int64LE(t).toBuffer().copy(e,r),r+8}function b(e,t,r){const i=new o.Int64LE(t).toArray();for(let t=0;t<8;t++)e.writeUInt8(i[t],r+t);return r+8}t.verifuint=l,t.readUInt64LE=d,t.readUInt64LEasString=c,t.readInt64LE=f,t.writeUInt64LE=p,t.writeUInt64LEasString=m,t.writeInt64LE=b,t.readVarInt=function(e,t){return{number:s.decode(e,t),size:s.decode.bytes}},t.writeVarInt=function(e,t,r){return s.encode(t,e,r),s.encode.bytes},t.cloneBuffer=function(e){const t=Buffer.allocUnsafe(e.length);return e.copy(t),t},t.pushDataSize=n.encodingLength,t.readPushDataInt=n.decode,t.varIntSize=s.encodingLength,t.writePushDataInt=n.encode,t.reverseBuffer=u.bufferUtils.reverseBuffer,t.getChunkSize=u.bufferUtils.getChunkSize;t.BufferWriter=class{constructor(e,t=0){this.buffer=e,this.offset=t,a(h.tuple(h.Buffer,h.UInt32),[e,t])}writeUInt8(e){this.offset=this.buffer.writeUInt8(e,this.offset)}writeUInt16(e){this.offset=this.buffer.writeUInt16LE(e,this.offset)}writeInt32(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}writeUInt32(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}writeInt64(e){this.offset=b(this.buffer,e,this.offset)}writeUInt64(e){this.offset="string"==typeof e?m(this.buffer,e,this.offset):p(this.buffer,e,this.offset)}writeVarInt(e){s.encode(e,this.buffer,this.offset),this.offset+=s.encode.bytes}writeSlice(e){if(this.buffer.lengththis.writeVarSlice(e)))}};t.BufferReader=class{constructor(e,t=0){this.buffer=e,this.offset=t,a(h.tuple(h.Buffer,h.UInt32),[e,t])}readUInt8(){const e=this.buffer.readUInt8(this.offset);return this.offset++,e}readUInt16(){const e=this.buffer.readUInt16LE(this.offset);return this.offset+=2,e}readInt32(){const e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}readUInt32(){const e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}readInt64(){const e=f(this.buffer,this.offset);return this.offset+=8,e}readUInt64(){const e=d(this.buffer,this.offset);return this.offset+=8,e}readUInt64String(){const e=c(this.buffer,this.offset);return this.offset+=8,e}readVarInt(){const e=s.decode(this.buffer,this.offset);return this.offset+=s.decode.bytes,e}readSlice(e){if(this.buffer.lengtho.includes(e.type))).length;return a+4*l(e.length)+e.reduce(((e,t)=>e+d(t)),0)+4*l(t.length)+t.reduce(((e,t)=>e+f(t)),0)+(r?e.length-r+2:0)}function g(e,t){return Math.ceil(b(e,t)/4)}function y(e,{txType:r,longTermFeeRate:i,dustThreshold:n}){const s=c({type:r,script:{length:t.INPUT_SCRIPT_LENGTH[r]}}),o=i?Math.min(e,i):0,a=Math.max(o,h);return Math.max(n||0,m(a,s))}function v(e,r=!1){if(n.isBN(e))return e;const i=r?t.ZERO:void 0;if(!e||"string"!=typeof e||!/^\d+$/.test(e))return i;try{return new n(e)}catch(e){return i}}function w(e,r=!1){return e.reduce(((e,i)=>{if(!e)return e;const n=v(i.value);return n?n.add(e):r?t.ZERO.add(e):void 0}),t.ZERO)}function _(e,t,r,{baseFee:i=0,floorBaseFee:n}){const s=m(r,g(e,t));return i&&n?i*(1+Math.floor(s/i)):i+s}t.getVarIntSize=l,t.inputWeight=d,t.inputBytes=c,t.outputWeight=f,t.outputBytes=p,t.getFeeForBytes=m,t.transactionWeight=b,t.transactionBytes=g,t.getDustAmount=y,t.bignumberOrNaN=v,t.sumOrNaN=w,t.getFeePolicy=function(e){return(0,s.isNetworkType)("doge",e)?"doge":(0,s.isNetworkType)("zcash",e)?"zcash":"bitcoin"};const M=5e3,E=2,S=150,T=34;function I(e,t,r,s={}){var{feePolicy:o}=s,a=i(s,["feePolicy"]);switch(o){case"doge":return function(e,t,r,s){var{dustThreshold:o=0}=s;const a=_(e,t,r,i(s,["dustThreshold"])),u=new n(o);return a+t.filter((({value:e})=>e&&new n(e).lt(u))).length*o}(e,t,r,a);case"zcash":return function(e,t,r,i){const n=_(e,t,r,i),s=e.reduce(((e,t)=>e+c(t)),0),o=t.reduce(((e,t)=>e+p(t)),0),a=Math.max(E,Math.ceil(s/S),Math.ceil(o/T));return Math.max(a*M,n)}(e,t,r,a);default:return _(e,t,r,a)}}function O(e,t){return new n(e.value).sub(new n(m(t,c(e))))}t.getFee=I,t.finalize=function(e,r,i,s){const o={script:{length:t.OUTPUT_SCRIPT_LENGTH[s.txType]}},a=I(e,r,i,s),u=I(e,[...r,o],i,s),h=w(e),l=w(r);if(!h||!l||h.sub(l).lt(new n(a)))return{fee:a};const d=h.sub(l.add(new n(u))),c=y(i,s),f=r.map((e=>Object.assign({},e,{value:e.value})));return d.gte(new n(c))&&f.push({value:d.toString(),script:{length:t.OUTPUT_SCRIPT_LENGTH[s.txType]}}),{inputs:e,outputs:f,fee:h.sub(w(f,!0)).toNumber()}},t.anyOf=function(e){return(t,r,i,n)=>{let s={fee:0};for(let o=0;o{const n=O(r,e).sub(O(i,e));return n.eq(t.ZERO)?r.i-i.i:n.isNeg()?1:-1}},t.filterCoinbase=function(e,t){return e.filter((e=>!(e.coinbase&&!e.required)||e.confirmations>=t))}},"../utxo-lib/lib/coinselect/index.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coinselect=void 0;const i=r("../utxo-lib/lib/coinselect/inputs/accumulative.js"),n=r("../utxo-lib/lib/coinselect/inputs/bnb.js"),s=r("../utxo-lib/lib/coinselect/coinselectUtils.js"),o=r("../utxo-lib/lib/coinselect/tryconfirmed.js");t.coinselect=function(e,t,r,a){const u=a.skipPermutation?e:e.sort((0,s.sortByScore)(r));return(0,o.tryConfirmed)((0,s.anyOf)([n.bnb,i.accumulative]),a)(u,t,r,a)}},"../utxo-lib/lib/coinselect/inputs/accumulative.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accumulative=void 0;const i=r("../../node_modules/bn.js/lib/bn.js"),n=r("../utxo-lib/lib/coinselect/coinselectUtils.js");t.accumulative=function(e,t,r,s){let o=n.ZERO;const a=[],u=(0,n.sumOrNaN)(t),h=[],l=[];if(e.forEach((e=>{if(e.required){h.push(e);const t=(0,n.bignumberOrNaN)(e.value,!0);o=o.add(t),a.push(e)}else l.push(e)})),h.length>0){const e=(0,n.finalize)(h,t,r,s);if(e.inputs)return e}for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bnb=void 0;const i=r("../../node_modules/bn.js/lib/bn.js"),n=r("../utxo-lib/lib/coinselect/coinselectUtils.js"),s=1e6;t.bnb=function(e,t,r,o){if(o.baseFee)return{fee:0};if(e.find((e=>e.required)))return{fee:0};const a=(0,n.getFeeForBytes)(r,(0,n.outputBytes)({script:{length:n.OUTPUT_SCRIPT_LENGTH[o.txType]}}))+(0,n.getDustAmount)(r,o),u=(0,n.transactionBytes)([],t),h=(0,n.getFeeForBytes)(r,u),l=(0,n.sumOrNaN)(t);if(!l)return{fee:0};const d=l.add(new i(h)),c=d.add(new i(a)),f=function(e,t){return e.map((e=>{const r=(0,n.bignumberOrNaN)(e.value);if(!r)return{utxo:e,effectiveValue:n.ZERO};const s=(0,n.getFeeForBytes)(t,(0,n.inputBytes)(e));return{utxo:e,effectiveValue:r.sub(new i(s))}}))}(e,r).filter((({effectiveValue:e})=>e.gt(n.ZERO)&&e.lte(c))).sort(((e,t)=>{const r=t.effectiveValue.sub(e.effectiveValue).toNumber();return 0!==r?r:e.utxo.i-t.utxo.i}));if(f.reduce(((e,{effectiveValue:t})=>e.add(t)),n.ZERO).lt(d))return{fee:0};const p=function(e,t,r){if(0===e.length)return null;let i=s;const o=[];let a=n.ZERO,u=!1,h=!1,l=e.reduce(((e,t)=>t.effectiveValue.add(e)),n.ZERO),d=0;for(;!u;){if(i<=0)return null;if(a.gt(r))h=!0;else if(a.gte(t))u=!0;else if(d>=e.length)h=!0;else if(a.add(l).lt(t)){if(0===d)return null;h=!0}else l=l.sub(e[d].effectiveValue),o[d]=!0,a=a.add(e[d].effectiveValue),d++;if(h){for(h=!1,d--;!o[d];)if(l=l.add(e[d].effectiveValue),d--,d<0)return null;o[d]=!1,a=a.sub(e[d].effectiveValue),d++}i--}return o}(f,d,c);if(null!==p){const e=[];for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.split=void 0;const i=r("../../node_modules/bn.js/lib/bn.js"),n=r("../utxo-lib/lib/coinselect/coinselectUtils.js");t.split=function(e,t,r,s){const o=s.coinbase||100,a=(0,n.filterCoinbase)(e,o),u=(0,n.getFee)(a,t,r,s);if(0===t.length)return{fee:u};const h=(0,n.sumOrNaN)(a),l=(0,n.sumOrNaN)(t,!0);if(!h)return{fee:u};const d=h.sub(l).sub(new i(u));if(d.lt(n.ZERO))return{fee:u};const c=t.reduce(((e,t)=>e+((0,n.bignumberOrNaN)(t.value)?0:1)),0);if(d.isZero()||0===c)return(0,n.finalize)(a,t,r,s);const f=d.div(new i(c)),p=(0,n.getDustAmount)(r,s);if(c&&f.lt(new i(p)))return{fee:u};const m=t.map((e=>{if(e.value)return e;const t=Object.assign({},e);return t.value=f.toString(),t}));return(0,n.finalize)(a,m,r,s)}},"../utxo-lib/lib/coinselect/tryconfirmed.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tryConfirmed=void 0;const i=r("../utxo-lib/lib/coinselect/coinselectUtils.js");function n(e,t,r){const i=[],n=[];for(let s=0;s=t:o.confirmations>=r)||o.required?i.push(o):n.push(o)}return{usable:i,unusable:n}}t.tryConfirmed=function(e,t){const r=t.own||1,s=t.other||6,o=t.coinbase||100;return(t,a,u,h)=>{t.forEach((e=>{if(null==e.coinbase||null==e.own||null==e.confirmations)throw new Error("Missing information.")}));const l=(0,i.filterCoinbase)(t,o);if(0===l.length)return{fee:0};const d=[];let c;for(c=r;c>0;c--)d.push({other:s,own:c});for(c=s-1;c>0;c--)d.push({other:c,own:1});d.push({other:1,own:0}),d.push({other:0,own:0});let f=l,p=[];for(c=0;c0){p=p.concat(r.usable);f=r.unusable;const t=e(p,a,u,h);if(t.inputs)return t;if(0===f.length)return t}}throw new Error("Unexpected unreturned result")}}},"../utxo-lib/lib/compose/coinselect.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coinselect=void 0;const i=r("../../node_modules/bn.js/lib/bn.js"),n=r("../utxo-lib/lib/coinselect/outputs/split.js"),s=r("../utxo-lib/lib/coinselect/index.js"),o=r("../utxo-lib/lib/coinselect/coinselectUtils.js"),a=r("../utxo-lib/lib/compose/composeUtils.js");t.coinselect=function(e,t,r,u,h,l,d,c,f,p,m,b,g){const y=(0,a.convertInputs)(t,u,e),v=(0,a.convertOutputs)(r,p,e),w={txType:e,dustThreshold:f,longTermFeeRate:l,baseFee:m,floorBaseFee:b,skipPermutation:g,feePolicy:(0,o.getFeePolicy)(p)},_=(d?n.split:s.coinselect)(y,v,h,w);if(!_.inputs||!_.outputs)return{success:!1};const{fee:M,inputs:E,outputs:S}=_,T=-1!==c?S[c].value:void 0,I=S.filter(((e,t)=>t!==r.length)).map((e=>e.value)).reduce(((e,t)=>e.add(new i(t))),new i(0)).add(new i(M)).toString(),O=(0,o.transactionBytes)(E,S);return{success:!0,payload:{inputs:E,outputs:S,fee:M,feePerByte:M/O,bytes:O,max:T,totalSpent:I}}}},"../utxo-lib/lib/compose/composeUtils.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertFeeRate=t.convertOutputs=t.getScriptFromAddress=t.convertInputs=void 0;const i=r("../utxo-lib/lib/address.js"),n=r("../utxo-lib/lib/coinselect/coinselectUtils.js");function s(e,t){return{length:i.toOutputScript(e,t).length}}t.convertInputs=function(e,t=0,r){return e.map(((e,i)=>({type:r,i,script:{length:n.INPUT_SCRIPT_LENGTH[r]},value:e.value,own:e.own,coinbase:e.coinbase,confirmations:null==e.height?0:1+t-e.height,required:e.required}))).map((e=>Object.assign(e,{weight:(0,n.inputWeight)(e)})))},t.getScriptFromAddress=s,t.convertOutputs=function(e,t,r){const i={length:n.OUTPUT_SCRIPT_LENGTH[r]};return e.map((e=>{if("complete"===e.type)return{value:e.amount,script:s(e.address,t)};if("noaddress"===e.type)return{value:e.amount,script:i};if("opreturn"===e.type)return{value:"0",script:{length:2+e.dataHex.length/2}};if("send-max"===e.type)return{script:s(e.address,t)};if("send-max-noaddress"===e.type)return{script:i};throw new Error("WRONG-OUTPUT-TYPE")})).map((e=>Object.assign(e,{weight:(0,n.outputWeight)(e)})))},t.convertFeeRate=function(e){const t="string"==typeof e?Number(e):e;if(!(Number.isNaN(t)||!Number.isFinite(t)||t>Number.MAX_SAFE_INTEGER||t<=0))return t}},"../utxo-lib/lib/compose/index.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.composeTx=void 0;const i=r("../utxo-lib/lib/compose/request.js"),n=r("../utxo-lib/lib/compose/result.js"),s=r("../utxo-lib/lib/compose/transaction.js"),o=r("../utxo-lib/lib/compose/composeUtils.js"),a=r("../utxo-lib/lib/compose/coinselect.js");t.composeTx=function({txType:e,utxos:t,outputs:r,height:u,feeRate:h,longTermFeeRate:l,basePath:d,network:c,changeId:f,changeAddress:p,dustThreshold:m,baseFee:b,floorBaseFee:g,skipPermutation:y}){if(0===r.length)return n.empty;if(0===t.length)return{type:"error",error:"NOT-ENOUGH-FUNDS"};const v=(0,o.convertFeeRate)(h);if(!v)return{type:"error",error:"INCORRECT-FEE-RATE"};let w;if(l&&(w=(0,o.convertFeeRate)(l),!w))return{type:"error",error:"INCORRECT-FEE-RATE"};let _={exists:!1,id:0};try{_=i.getMax(r)}catch(e){return e instanceof Error?{type:"error",error:e.message}:{type:"error",error:`${e}`}}const M=i.splitByCompleteness(r);let E={success:!1};try{E=(0,a.coinselect)(e||"p2pkh",t,r,u,v,w,_.exists,_.id,m,c,b,g,y)}catch(e){return e instanceof Error?{type:"error",error:e.message}:{type:"error",error:`${e}`}}if(!E.success)return{type:"error",error:"NOT-ENOUGH-FUNDS"};if(M.incomplete.length>0)return n.getNonfinalResult(E);const S=s.createTransaction(t,E.payload.inputs,M.complete,E.payload.outputs,d,f,p,c,y);return n.getFinalResult(E,S)}},"../utxo-lib/lib/compose/permutation.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Permutation=void 0;class r{constructor(e,t){this.sorted=e,this.permutation=t}static fromFunction(e,t){const i=e.map(((e,t)=>t)).sort(((r,i)=>t(e[r],e[i]))),n=new r([],i);return n.forEach(((t,r)=>{n.sorted[r]=e[t]})),n}forEach(e){this.permutation.forEach(e)}map(e){const t=this.sorted.map(e);return new r(t,this.permutation)}}t.Permutation=r},"../utxo-lib/lib/compose/request.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMax=t.splitByCompleteness=void 0,t.splitByCompleteness=function(e){const t=[],r=[];return e.forEach((e=>{"complete"===e.type||"send-max"===e.type||"opreturn"===e.type?t.push(e):r.push(e)})),{complete:t,incomplete:r}},t.getMax=function(e){const t=e.filter((e=>"send-max-noaddress"===e.type||"send-max"===e.type));if(t.length>=2)throw new Error("TWO-SEND-MAX");return{id:e.findIndex((e=>"send-max-noaddress"===e.type||"send-max"===e.type)),exists:1===t.length}}},"../utxo-lib/lib/compose/result.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFinalResult=t.getNonfinalResult=t.empty=void 0,t.empty={type:"error",error:"EMPTY"},t.getNonfinalResult=function(e){const{max:t,fee:r,feePerByte:i,bytes:n,totalSpent:s}=e.payload;return{type:"nonfinal",fee:r.toString(),feePerByte:i.toString(),bytes:n,max:t,totalSpent:s}},t.getFinalResult=function(e,t){const{max:r,fee:i,feePerByte:n,bytes:s,totalSpent:o}=e.payload;return{type:"final",fee:i.toString(),feePerByte:n.toString(),bytes:s,transaction:t,max:r,totalSpent:o}}},"../utxo-lib/lib/compose/transaction.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.createTransaction=void 0;const i=r("../../node_modules/bn.js/lib/bn.js"),n=r("../utxo-lib/lib/address.js"),s=r("../utxo-lib/lib/payments/embed.js"),o=r("../utxo-lib/lib/compose/permutation.js"),a=r("../utxo-lib/lib/bufferutils.js");t.createTransaction=function(e,t,r,u,h,l,d,c,f){const p=t.map((t=>function(e,t){return{hash:(0,a.reverseBuffer)(Buffer.from(e.transactionHash,"hex")),index:e.index,path:t.concat([...e.addressPath]),amount:e.value}}(e[t.i],h))),m=u.map(((e,t)=>{const i=t===r.length,o=r[t];if(o&&"opreturn"===o.type)return function(e){const t=Buffer.from(e,"hex");return{output:{opReturnData:t,value:void 0},script:(0,s.p2data)({data:[t]}).output}}(o.dataHex);return function(e,t,r,i,s,o){return{output:o?{path:[...i,1,s],value:t}:{address:e,value:t},script:n.toOutputScript(e,r)}}(o?o.address:d,e.value,c,h,l,i)}));return f?{inputs:p,outputs:new o.Permutation(m.map((e=>e.output)),m.map(((e,t)=>t)))}:(p.sort(((e,t)=>{return r=e.hash,i=e.index,n=t.hash,s=t.index,(0,a.reverseBuffer)(r).compare((0,a.reverseBuffer)(n))||i-s;var r,i,n,s})),{inputs:p,outputs:o.Permutation.fromFunction(m,((e,t)=>{const r="string"==typeof e.output.value?e.output.value:"0",n="string"==typeof t.output.value?t.output.value:"0";return function(e,t,r,n){return new i(t).cmp(new i(n))||e.compare(r)}(e.script,r,t.script,n)})).map((e=>e.output))})}},"../utxo-lib/lib/crypto.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmacSHA512=t.hash256=t.hash160blake256=t.hash160=t.blake256=t.sha256=t.sha1=t.ripemd160=void 0;const i=r("../../node_modules/blake-hash/js.js"),n=r("../../node_modules/create-hash/browser.js"),s=r("../../node_modules/create-hmac/browser.js");function o(e){try{return n("rmd160").update(e).digest()}catch(t){return n("ripemd160").update(e).digest()}}function a(e){return n("sha256").update(e).digest()}function u(e){return i("blake256").update(e).digest()}t.ripemd160=o,t.sha1=function(e){return n("sha1").update(e).digest()},t.sha256=a,t.blake256=u,t.hash160=function(e){return o(a(e))},t.hash160blake256=function(e){return o(u(e))},t.hash256=function(e){return a(a(e))},t.hmacSHA512=function(e,t){return s("sha512",e).update(t).digest()}},"../utxo-lib/lib/derivation.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.deriveAddresses=t.getXpubOrDescriptorInfo=void 0;const i=r("../../node_modules/bs58/index.js"),n=r("../utils/lib/index.js"),s=r("../utxo-lib/lib/payments/index.js"),o=r("../utxo-lib/lib/bip32.js"),a=r("../utxo-lib/lib/networks.js"),u={76067358:"p2pkh",77429938:"p2sh",78792518:"p2wpkh",70617039:"p2pkh",71979618:"p2sh",73342198:"p2wpkh",27108450:"p2pkh",28471030:"p2sh"},h={76067358:"0'",77429938:"0'",78792518:"0'",70617039:"1'",71979618:"1'",73342198:"1'",27108450:"2'",28471030:"2'"},l={p2pkh:"44'",p2sh:"49'",p2wpkh:"84'",p2tr:"86'"},d=e=>{const t=Buffer.from((0,i.decode)(e)).readUInt32BE();if(!(e=>!!u[e])(t))throw new Error(`Unknown xpub version: ${e}`);return t},c=(e,t,r)=>(0,o.fromBase58)(e,Object.assign(Object.assign({},r),{bip32:Object.assign(Object.assign({},r.bip32),{public:t})})),f=(e,t,r)=>{const[i,s,o,a]=t.match(/^([a-z]+\()+\[([a-z0-9]{8}(?:\/[0-9]+'?){3,})\]([xyztuv]pub[a-zA-Z0-9]*)\/<0;1>\/\*\)+$/)||(0,n.throwError)(`Descriptor cannot be parsed: ${t}`),[u,...h]=o.split("/"),l=d(a);return{levels:h,paymentType:e,node:c(a,l,r)}};t.getXpubOrDescriptorInfo=(e,t=a.bitcoin)=>e.startsWith("pkh(")?f("p2pkh",e,t):e.startsWith("sh(wpkh(")?f("p2sh",e,t):e.startsWith("wpkh(")?f("p2wpkh",e,t):e.startsWith("tr(")?f("p2tr",e,t):((e,t)=>{const r=d(e),i=u[r],n=176===t.wif?"2'":h[r],s=l[i],o=c(e,r,t);return{levels:[s,n,(o.index<<1>>>1)+"'"],paymentType:i,node:o}})(e,t);t.deriveAddresses=(e,r,i,o,u=a.bitcoin)=>{const{levels:h,node:l,paymentType:d}=(0,t.getXpubOrDescriptorInfo)(e,u),c=((e,t)=>r=>{switch(e){case"p2pkh":return(0,s.p2pkh)({pubkey:r,network:t});case"p2sh":return(0,s.p2sh)({redeem:(0,s.p2wpkh)({pubkey:r,network:t}),network:t});case"p2wpkh":return(0,s.p2wpkh)({pubkey:r,network:t});case"p2tr":return(0,s.p2tr)({pubkey:r,network:t});default:throw new Error(`Unknown payment type '${e}'`)}})(d,u),f="receive"===r?0:1,p=l.derive(f);return Array.from(Array(o).keys()).map((e=>p.derive(i+e).publicKey)).map((e=>c(e).address||(0,n.throwError)("Cannot convert pubkey to address"))).map(((e,t)=>({address:e,path:`m/${h.join("/")}/${f}/${i+t}`})))}},"../utxo-lib/lib/discovery.js":function(e,t,r){"use strict";var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=i))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.discovery=t.countUnusedFromEnd=void 0;const s=r("../utxo-lib/lib/derivation.js");t.countUnusedFromEnd=(e,t,r)=>{const i=e.length>r?e.length-r:0;for(let r=e.length;r>i;--r)if(!t(e[r-1]))return e.length-r;return e.length};t.discovery=(e,r,o,a,u=20)=>{const h=(l,d)=>n(void 0,void 0,void 0,(function*(){const n=(0,t.countUnusedFromEnd)(d,(e=>e.empty),u);if(n>=u)return d;const c=u-n,f=(0,s.deriveAddresses)(r,o,l,c,a),p=yield i.all(f.map(e));return h(l+c,d.concat(p))}));return h(0,[])}},"../utxo-lib/lib/index.js":(e,t,r)=>{"use strict";t.c5=t.PP=t._K=t.Lk=t.YW=void 0;const i=r("../utxo-lib/lib/address.js");t.Lk=i;const n=r("../utxo-lib/lib/bip32.js");t._K=n;r("../utxo-lib/lib/bufferutils.js");r("../utxo-lib/lib/crypto.js");const s=r("../utxo-lib/lib/payments/index.js");t.PP=s;r("../utxo-lib/lib/script/index.js");r("../utxo-lib/lib/networks.js");const o=r("../utxo-lib/lib/compose/index.js");Object.defineProperty(t,"c5",{enumerable:!0,get:function(){return o.composeTx}});const a=r("../utxo-lib/lib/derivation.js");const u=r("../utxo-lib/lib/discovery.js");var h=r("../utxo-lib/lib/transaction/index.js");Object.defineProperty(t,"YW",{enumerable:!0,get:function(){return h.Transaction}})},"../utxo-lib/lib/networks.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNetworkType=t.doge=t.decredSim=t.decredTest=t.decred=t.komodo=t.peercoinTest=t.peercoin=t.zcashTest=t.zcash=t.dashTest=t.dash=t.litecoinTest=t.litecoin=t.bitcoingold=t.bitcoincashTest=t.bitcoincash=t.testnet=t.regtest=t.bitcoin=void 0;const i=r("../../node_modules/typeforce/index.js");t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.bitcoincash={messagePrefix:"Bitcoin Signed Message:\n",bech32:"",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128,forkId:0},t.bitcoincashTest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239,forkId:0},t.bitcoingold={messagePrefix:"Bitcoin Gold Signed Message:\n",bech32:"btg",bip32:{public:76067358,private:76066276},pubKeyHash:38,scriptHash:23,wif:128,forkId:79},t.litecoin={messagePrefix:"Litecoin Signed Message:\n",bech32:"ltc",bip32:{public:27108450,private:27106558},pubKeyHash:48,scriptHash:50,wif:176},t.litecoinTest={messagePrefix:"Litecoin Signed Message:\n",bech32:"tltc",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:58,wif:176},t.dash={messagePrefix:"DarkCoin Signed Message:\n",bech32:"",bip32:{public:50221772,private:50221816},pubKeyHash:76,scriptHash:16,wif:204},t.dashTest={messagePrefix:"DarkCoin Signed Message:\n",bech32:"",bip32:{public:70617039,private:70615956},pubKeyHash:140,scriptHash:19,wif:239},t.zcash={messagePrefix:"ZCash Signed Message:\n",bech32:"",bip32:{public:76067358,private:76066276},pubKeyHash:7352,scriptHash:7357,wif:128},t.zcashTest={messagePrefix:"ZCash Signed Message:\n",bech32:"",bip32:{public:70617039,private:70615956},pubKeyHash:7461,scriptHash:7354,wif:239},t.peercoin={messagePrefix:"Peercoin Signed Message:\n",bech32:"pc",bip32:{public:76067358,private:76066276},pubKeyHash:55,scriptHash:117,wif:0},t.peercoinTest={messagePrefix:"Peercoin Signed Message:\n",bech32:"tpc",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:0},t.komodo={messagePrefix:"Komodo Signed Message:\n",bech32:"",bip32:{public:76067358,private:76066276},pubKeyHash:60,scriptHash:85,wif:188},t.decred={messagePrefix:"Decred Signed Message:\n",bech32:"",bip32:{public:50178342,private:50177256},pubKeyHash:1855,scriptHash:1818,wif:8926},t.decredTest={messagePrefix:"Decred Signed Message:\n",bech32:"",bip32:{public:70617041,private:70615959},pubKeyHash:3873,scriptHash:3836,wif:8974},t.decredSim={messagePrefix:"Decred Signed Message:\n",bech32:"",bip32:{public:69254461,private:69253379},pubKeyHash:3729,scriptHash:3692,wif:8967},t.doge={messagePrefix:"Dogecoin Signed Message:\n",bech32:"",bip32:{public:49990397,private:49988504},pubKeyHash:30,scriptHash:22,wif:158};const n={bitcoinCash:[t.bitcoincash,t.bitcoincashTest],dash:[t.dash,t.dashTest],decred:[t.decred,t.decredTest,t.decredSim],peercoin:[t.peercoin,t.peercoinTest],zcash:[t.zcash,t.zcashTest,t.komodo],litecoin:[t.litecoin,t.litecoinTest],doge:[t.doge]};t.isNetworkType=function(e,t){if("string"!=typeof e||!t||!n[e])return!1;try{i({bip32:{public:i.UInt32,private:i.UInt32},pubKeyHash:i.anyOf(i.UInt8,i.UInt16),scriptHash:i.anyOf(i.UInt8,i.UInt16)},t)}catch(e){return!1}return!!n[e].find((e=>!(e.bip32.public!==t.bip32.public||e.bip32.private!==t.bip32.private||(e.bech32||t.bech32)&&e.bech32!==t.bech32||(e.forkId||t.forkId)&&e.forkId!==t.forkId||e.pubKeyHash!==t.pubKeyHash||e.scriptHash!==t.scriptHash)))}},"../utxo-lib/lib/payments/embed.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.p2data=void 0;const i=r("../../node_modules/typeforce/index.js"),n=r("../utxo-lib/lib/networks.js"),s=r("../utxo-lib/lib/script/index.js"),o=r("../utxo-lib/lib/payments/lazy.js"),{OPS:a}=s;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),i({network:i.maybe(i.Object),output:i.maybe(i.Buffer),data:i.maybe(i.arrayOf(i.Buffer))},e);const r={name:"embed",network:e.network||n.bitcoin};if(o.prop(r,"output",(()=>{if(e.data)return s.compile([a.OP_RETURN].concat(e.data))})),o.prop(r,"data",(()=>{if(e.output)return s.decompile(e.output).slice(1)})),t.validate&&e.output){const t=s.decompile(e.output);if(t[0]!==a.OP_RETURN)throw new TypeError("Output is invalid");if(!t.slice(1).every(i.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.data,r.data))throw new TypeError("Data mismatch")}return Object.assign(r,e)}},"../utxo-lib/lib/payments/index.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sstxsh=t.sstxpkh=t.sstxcommitment=t.sstxchange=t.p2wsh=t.p2wpkh=t.p2tr=t.p2sh=t.p2pkh=t.p2pk=t.p2ms=t.embed=void 0;var i=r("../utxo-lib/lib/payments/embed.js");Object.defineProperty(t,"embed",{enumerable:!0,get:function(){return i.p2data}});var n=r("../utxo-lib/lib/payments/p2ms.js");Object.defineProperty(t,"p2ms",{enumerable:!0,get:function(){return n.p2ms}});var s=r("../utxo-lib/lib/payments/p2pk.js");Object.defineProperty(t,"p2pk",{enumerable:!0,get:function(){return s.p2pk}});var o=r("../utxo-lib/lib/payments/p2pkh.js");Object.defineProperty(t,"p2pkh",{enumerable:!0,get:function(){return o.p2pkh}});var a=r("../utxo-lib/lib/payments/p2sh.js");Object.defineProperty(t,"p2sh",{enumerable:!0,get:function(){return a.p2sh}});var u=r("../utxo-lib/lib/payments/p2tr.js");Object.defineProperty(t,"p2tr",{enumerable:!0,get:function(){return u.p2tr}});var h=r("../utxo-lib/lib/payments/p2wpkh.js");Object.defineProperty(t,"p2wpkh",{enumerable:!0,get:function(){return h.p2wpkh}});var l=r("../utxo-lib/lib/payments/p2wsh.js");Object.defineProperty(t,"p2wsh",{enumerable:!0,get:function(){return l.p2wsh}});var d=r("../utxo-lib/lib/payments/sstxchange.js");Object.defineProperty(t,"sstxchange",{enumerable:!0,get:function(){return d.sstxchange}});var c=r("../utxo-lib/lib/payments/sstxcommitment.js");Object.defineProperty(t,"sstxcommitment",{enumerable:!0,get:function(){return c.sstxcommitment}});var f=r("../utxo-lib/lib/payments/sstxpkh.js");Object.defineProperty(t,"sstxpkh",{enumerable:!0,get:function(){return f.sstxpkh}});var p=r("../utxo-lib/lib/payments/sstxsh.js");Object.defineProperty(t,"sstxsh",{enumerable:!0,get:function(){return p.sstxsh}})},"../utxo-lib/lib/payments/lazy.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.value=t.prop=void 0,t.prop=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=r.call(this);return this[t]=e,e},set(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){let t;return()=>(void 0!==t||(t=e()),t)}},"../utxo-lib/lib/payments/p2ms.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.p2ms=void 0;const i=r("../../node_modules/tiny-secp256k1/js.js"),n=r("../../node_modules/typeforce/index.js"),s=r("../utxo-lib/lib/networks.js"),o=r("../utxo-lib/lib/script/index.js"),a=r("../utxo-lib/lib/payments/lazy.js"),{OPS:u}=o,h=u.OP_RESERVED;function l(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function r(e){return o.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===u.OP_0)}t=Object.assign({validate:!0},t||{}),n({network:n.maybe(n.Object),m:n.maybe(n.Number),n:n.maybe(n.Number),output:n.maybe(n.Buffer),pubkeys:n.maybe(n.arrayOf(i.isPoint)),signatures:n.maybe(n.arrayOf(r)),input:n.maybe(n.Buffer)},e);const d={name:"p2ms",network:e.network||s.bitcoin};let c=[],f=!1;function p(e){f||(f=!0,c=o.decompile(e),d.m=c[0]-h,d.n=c[c.length-2]-h,d.pubkeys=c.slice(1,-2))}if(a.prop(d,"output",(()=>{if(e.m&&d.n&&e.pubkeys)return o.compile([].concat(h+e.m,e.pubkeys,h+d.n,u.OP_CHECKMULTISIG))})),a.prop(d,"m",(()=>{if(d.output)return p(d.output),d.m})),a.prop(d,"n",(()=>{if(d.pubkeys)return d.pubkeys.length})),a.prop(d,"pubkeys",(()=>{if(e.output)return p(e.output),d.pubkeys})),a.prop(d,"signatures",(()=>{if(e.input)return o.decompile(e.input).slice(1)})),a.prop(d,"input",(()=>{if(e.signatures)return o.compile([u.OP_0].concat(e.signatures))})),a.prop(d,"witness",(()=>{if(d.input)return[]})),a.prop(d,"name",(()=>{if(d.m&&d.n)return`p2ms(${d.m} of ${d.n})`})),t.validate){if(e.output){if(p(e.output),!n.Number(c[0]))throw new TypeError("Output is invalid");if(!n.Number(c[c.length-2]))throw new TypeError("Output is invalid");if(c[c.length-1]!==u.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(d.m<=0||d.n>16||d.m>d.n||d.n!==c.length-3)throw new TypeError("Output is invalid");if(!d.pubkeys.every((e=>i.isPoint(e))))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==d.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==d.n)throw new TypeError("n mismatch");if(e.pubkeys&&!l(e.pubkeys,d.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(d.n=e.pubkeys.length,d.nd.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==u.OP_0)throw new TypeError("Input is invalid");if(0===d.signatures.length||!d.signatures.every(r))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!l(e.signatures,d.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(d,e)}},"../utxo-lib/lib/payments/p2pk.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.p2pk=void 0;const i=r("../../node_modules/tiny-secp256k1/js.js"),n=r("../../node_modules/typeforce/index.js"),s=r("../utxo-lib/lib/networks.js"),o=r("../utxo-lib/lib/script/index.js"),a=r("../utxo-lib/lib/payments/lazy.js"),{OPS:u}=o;t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),n({network:n.maybe(n.Object),output:n.maybe(n.Buffer),pubkey:n.maybe(i.isPoint),signature:n.maybe(o.isCanonicalScriptSignature),input:n.maybe(n.Buffer)},e);const r=a.value((()=>o.decompile(e.input))),h={name:"p2pk",network:e.network||s.bitcoin};if(a.prop(h,"output",(()=>{if(e.pubkey)return o.compile([e.pubkey,u.OP_CHECKSIG])})),a.prop(h,"pubkey",(()=>{if(e.output)return e.output.subarray(1,-1)})),a.prop(h,"signature",(()=>{if(e.input)return r()[0]})),a.prop(h,"input",(()=>{if(e.signature)return o.compile([e.signature])})),a.prop(h,"witness",(()=>{if(h.input)return[]})),t.validate){if(e.output){if(e.output[e.output.length-1]!==u.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!i.isPoint(h.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(h.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(h.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==r().length)throw new TypeError("Input is invalid");if(!o.isCanonicalScriptSignature(h.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(h,e)}},"../utxo-lib/lib/payments/p2pkh.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.p2pkh=void 0;const i=r("../../node_modules/tiny-secp256k1/js.js"),n=r("../../node_modules/typeforce/index.js"),s=r("../utxo-lib/lib/bs58check.js"),o=r("../utxo-lib/lib/crypto.js"),a=r("../utxo-lib/lib/networks.js"),u=r("../utxo-lib/lib/script/index.js"),h=r("../utxo-lib/lib/payments/lazy.js"),{OPS:l}=u;t.p2pkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),n({network:n.maybe(n.Object),address:n.maybe(n.String),hash:n.maybe(n.BufferN(20)),output:n.maybe(n.BufferN(25)),pubkey:n.maybe(i.isPoint),signature:n.maybe(u.isCanonicalScriptSignature),input:n.maybe(n.Buffer)},e);const r=h.value((()=>s.decodeAddress(e.address,e.network))),d=h.value((()=>u.decompile(e.input))),c=e.network||a.bitcoin,f={name:"p2pkh",network:c};if(h.prop(f,"address",(()=>{if(f.hash)return s.encodeAddress(f.hash,c.pubKeyHash,c)})),h.prop(f,"hash",(()=>e.output?e.output.subarray(3,23):e.address?r().hash:e.pubkey||f.pubkey?o.hash160(e.pubkey||f.pubkey):void 0)),h.prop(f,"output",(()=>{if(f.hash)return u.compile([l.OP_DUP,l.OP_HASH160,f.hash,l.OP_EQUALVERIFY,l.OP_CHECKSIG])})),h.prop(f,"pubkey",(()=>{if(e.input)return d()[1]})),h.prop(f,"signature",(()=>{if(e.input)return d()[0]})),h.prop(f,"input",(()=>{if(e.pubkey&&e.signature)return u.compile([e.signature,e.pubkey])})),h.prop(f,"witness",(()=>{if(f.input)return[]})),t.validate){let t=Buffer.from([]);if(e.address){const{version:e,hash:i}=r();if(e!==c.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==i.length)throw new TypeError("Invalid address");t=i}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==l.OP_DUP||e.output[1]!==l.OP_HASH160||20!==e.output[2]||e.output[23]!==l.OP_EQUALVERIFY||e.output[24]!==l.OP_CHECKSIG)throw new TypeError("Output is invalid");const r=e.output.subarray(3,23);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.pubkey){const r=o.hash160(e.pubkey);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.input){const r=d();if(2!==r.length)throw new TypeError("Input is invalid");if(!u.isCanonicalScriptSignature(r[0]))throw new TypeError("Input has invalid signature");if(!i.isPoint(r[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&!e.signature.equals(r[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(r[1]))throw new TypeError("Pubkey mismatch");const n=o.hash160(r[1]);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch")}}return Object.assign(f,e)}},"../utxo-lib/lib/payments/p2sh.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.p2sh=void 0;const i=r("../../node_modules/typeforce/index.js"),n=r("../utxo-lib/lib/bs58check.js"),s=r("../utxo-lib/lib/crypto.js"),o=r("../utxo-lib/lib/networks.js"),a=r("../utxo-lib/lib/script/index.js"),u=r("../utxo-lib/lib/payments/lazy.js"),{OPS:h}=a;t.p2sh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),i({network:i.maybe(i.Object),address:i.maybe(i.String),hash:i.maybe(i.BufferN(20)),output:i.maybe(i.BufferN(23)),redeem:i.maybe({network:i.maybe(i.Object),output:i.maybe(i.Buffer),input:i.maybe(i.Buffer),witness:i.maybe(i.arrayOf(i.Buffer))}),input:i.maybe(i.Buffer),witness:i.maybe(i.arrayOf(i.Buffer))},e);let{network:r}=e;r||(r=e.redeem&&e.redeem.network||o.bitcoin);const l={name:"p2sh",network:r},d=u.value((()=>n.decodeAddress(e.address,e.network))),c=u.value((()=>a.decompile(e.input))),f=u.value((()=>{const t=c();return{network:r,output:t[t.length-1],input:a.compile(t.slice(0,-1)),witness:e.witness||[]}}));if(u.prop(l,"address",(()=>{if(l.hash)return n.encodeAddress(l.hash,r.scriptHash,r)})),u.prop(l,"hash",(()=>e.output?e.output.subarray(2,22):e.address?d().hash:l.redeem&&l.redeem.output?s.hash160(l.redeem.output):void 0)),u.prop(l,"output",(()=>{if(l.hash)return a.compile([h.OP_HASH160,l.hash,h.OP_EQUAL])})),u.prop(l,"redeem",(()=>{if(e.input)return f()})),u.prop(l,"input",(()=>{if(e.redeem&&e.redeem.input&&e.redeem.output)return a.compile([].concat(a.decompile(e.redeem.input),e.redeem.output))})),u.prop(l,"witness",(()=>l.redeem&&l.redeem.witness?l.redeem.witness:l.input?[]:void 0)),u.prop(l,"name",(()=>{const e=["p2sh"];return void 0!==l.redeem&&void 0!==l.redeem.name&&e.push(l.redeem.name),e.join("-")})),t.validate){let t=Buffer.from([]);if(e.address){const{version:e,hash:i}=d();if(e!==r.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==i.length)throw new TypeError("Invalid address");t=i}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(23!==e.output.length||e.output[0]!==h.OP_HASH160||20!==e.output[1]||e.output[22]!==h.OP_EQUAL)throw new TypeError("Output is invalid");const r=e.output.subarray(2,22);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}const i=e=>{if(e.output){const r=a.decompile(e.output);if(!r||r.length<1)throw new TypeError("Redeem.output too short");const i=s.hash160(e.output);if(t.length>0&&!t.equals(i))throw new TypeError("Hash mismatch");t=i}if(e.input){const t=e.input.length>0,r=e.witness&&e.witness.length>0;if(!t&&!r)throw new TypeError("Empty input");if(t&&r)throw new TypeError("Input and witness provided");if(t){const t=a.decompile(e.input);if(!a.isPushOnly(t))throw new TypeError("Non push-only scriptSig")}}};if(e.input){const e=c();if(!e||e.length<1)throw new TypeError("Input too short");if(!Buffer.isBuffer(f().output))throw new TypeError("Input is invalid");i(f())}if(e.redeem){if(e.redeem.network&&e.redeem.network!==r)throw new TypeError("Network mismatch");if(e.input){const t=f();if(e.redeem.output&&!e.redeem.output.equals(t.output))throw new TypeError("Redeem.output mismatch");if(e.redeem.input&&!e.redeem.input.equals(t.input))throw new TypeError("Redeem.input mismatch")}i(e.redeem)}if(e.witness&&e.redeem&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.redeem.witness,e.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(l,e)}},"../utxo-lib/lib/payments/p2tr.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.p2tr=void 0;const i=r("../../node_modules/tiny-secp256k1/js.js"),n=r("../../node_modules/typeforce/index.js"),s=r("../../node_modules/bech32/dist/index.js"),o=r("../utxo-lib/lib/networks.js"),a=r("../utxo-lib/lib/crypto.js"),u=r("../utxo-lib/lib/script/index.js"),h=r("../utxo-lib/lib/payments/lazy.js"),{OPS:l}=u,d=["TapLeaf","TapBranch","TapTweak","KeyAgg list","KeyAgg coefficient"].reduce(((e,t)=>{const r=a.sha256(Buffer.from(t));return e[t]=Buffer.concat([r,r]),e}),{}),c=new Uint8Array([2]);function f(e,t){return a.sha256(Buffer.concat([d[e],t]))}function p(e,t){let r;r=f("TapTweak",t?Buffer.concat([e,t]):e);const n=i.pointAddScalar(Buffer.concat([c,e]),r);return{parity:n[0]===c[0]?0:1,pubkey:n.slice(1)}}const m=e=>{const t=33===e.length?1:0;return e.subarray(t)};t.p2tr=function(e,t){if(!e.address&&!e.pubkey&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{});const r=e.network||o.bitcoin,a={name:"p2tr",network:r};n({network:n.maybe(n.Object),address:n.maybe(n.String),output:n.maybe(n.BufferN(34)),pubkey:n.maybe(n.anyOf(n.BufferN(32),n.BufferN(33)))},e);const d=h.value((()=>{const t=s.bech32m.decode(e.address),r=t.words.shift(),i=s.bech32m.fromWords(t.words);return{version:r,prefix:t.prefix,data:Buffer.from(i)}}));if(h.prop(a,"address",(()=>{if(!a.hash)return;const e=s.bech32m.toWords(a.hash);return e.unshift(1),s.bech32m.encode(r.bech32,e)})),h.prop(a,"hash",(()=>e.output?e.output.subarray(2):e.address?d().data:e.pubkey?p(m(e.pubkey)).pubkey:void 0)),h.prop(a,"output",(()=>{if(a.hash)return u.compile([l.OP_1,a.hash])})),t.validate){let t=Buffer.from([]);if(e.address){const{prefix:e,version:i,data:n}=d();if(e!==r.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(1!==i)throw new TypeError("Invalid address version");if(32!==n.length)throw new TypeError("Invalid address data");t=n}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(e.output[0]!==l.OP_1||32!==e.output[1])throw new TypeError("p2tr output is invalid");const r=e.output.subarray(2);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.pubkey){const r=p(m(e.pubkey)).pubkey;if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");if(t=r,!i.isPoint(Buffer.concat([c,m(e.pubkey)])))throw new TypeError("Invalid pubkey for p2tr")}}return Object.assign(a,e)}},"../utxo-lib/lib/payments/p2wpkh.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.p2wpkh=void 0;const i=r("../../node_modules/tiny-secp256k1/js.js"),n=r("../../node_modules/typeforce/index.js"),s=r("../../node_modules/bech32/dist/index.js"),o=r("../utxo-lib/lib/crypto.js"),a=r("../utxo-lib/lib/networks.js"),u=r("../utxo-lib/lib/script/index.js"),h=r("../utxo-lib/lib/payments/lazy.js"),{OPS:l}=u,d=Buffer.alloc(0);t.p2wpkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),n({address:n.maybe(n.String),hash:n.maybe(n.BufferN(20)),input:n.maybe(n.BufferN(0)),network:n.maybe(n.Object),output:n.maybe(n.BufferN(22)),pubkey:n.maybe(i.isPoint),signature:n.maybe(u.isCanonicalScriptSignature),witness:n.maybe(n.arrayOf(n.Buffer))},e);const r=h.value((()=>{const t=s.bech32.decode(e.address),r=t.words.shift(),i=s.bech32.fromWords(t.words);return{version:r,prefix:t.prefix,data:Buffer.from(i)}})),c=e.network||a.bitcoin,f={name:"p2wpkh",network:c};if(h.prop(f,"address",(()=>{if(!f.hash)return;const e=s.bech32.toWords(f.hash);return e.unshift(0),s.bech32.encode(c.bech32,e)})),h.prop(f,"hash",(()=>e.output?e.output.subarray(2,22):e.address?r().data:e.pubkey||f.pubkey?o.hash160(e.pubkey||f.pubkey):void 0)),h.prop(f,"output",(()=>{if(f.hash)return u.compile([l.OP_0,f.hash])})),h.prop(f,"pubkey",(()=>e.pubkey?e.pubkey:e.witness?e.witness[1]:void 0)),h.prop(f,"signature",(()=>{if(e.witness)return e.witness[0]})),h.prop(f,"input",(()=>{if(f.witness)return d})),h.prop(f,"witness",(()=>{if(e.pubkey&&e.signature)return[e.signature,e.pubkey]})),t.validate){let t=Buffer.from([]);if(e.address){const{prefix:e,version:i,data:n}=r();if(c&&c.bech32!==e)throw new TypeError("Invalid prefix or Network mismatch");if(0!==i)throw new TypeError("Invalid address version");if(20!==n.length)throw new TypeError("Invalid address data");t=n}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(22!==e.output.length||e.output[0]!==l.OP_0||20!==e.output[1])throw new TypeError("Output is invalid");if(t.length>0&&!t.equals(e.output.subarray(2)))throw new TypeError("Hash mismatch");t=e.output.subarray(2)}if(e.pubkey){const r=o.hash160(e.pubkey);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");if(t=r,!i.isPoint(e.pubkey)||33!==e.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(e.witness){if(2!==e.witness.length)throw new TypeError("Witness is invalid");if(!u.isCanonicalScriptSignature(e.witness[0]))throw new TypeError("Witness has invalid signature");if(!i.isPoint(e.witness[1])||33!==e.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(e.signature&&!e.signature.equals(e.witness[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(e.witness[1]))throw new TypeError("Pubkey mismatch");const r=o.hash160(e.witness[1]);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch")}}return Object.assign(f,e)}},"../utxo-lib/lib/payments/p2wsh.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.p2wsh=void 0;const i=r("../../node_modules/tiny-secp256k1/js.js"),n=r("../../node_modules/typeforce/index.js"),s=r("../../node_modules/bech32/dist/index.js"),o=r("../utxo-lib/lib/crypto.js"),a=r("../utxo-lib/lib/networks.js"),u=r("../utxo-lib/lib/script/index.js"),h=r("../utxo-lib/lib/payments/lazy.js"),{OPS:l}=u,d=Buffer.alloc(0);function c(e){return!(!Buffer.isBuffer(e)||65!==e.length||4!==e[0]||!i.isPoint(e))}t.p2wsh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),n({network:n.maybe(n.Object),address:n.maybe(n.String),hash:n.maybe(n.BufferN(32)),output:n.maybe(n.BufferN(34)),redeem:n.maybe({input:n.maybe(n.Buffer),network:n.maybe(n.Object),output:n.maybe(n.Buffer),witness:n.maybe(n.arrayOf(n.Buffer))}),input:n.maybe(n.BufferN(0)),witness:n.maybe(n.arrayOf(n.Buffer))},e);const r=h.value((()=>{const t=s.bech32.decode(e.address),r=t.words.shift(),i=s.bech32.fromWords(t.words);return{version:r,prefix:t.prefix,data:Buffer.from(i)}})),i=h.value((()=>u.decompile(e.redeem.input)));let{network:f}=e;f||(f=e.redeem&&e.redeem.network||a.bitcoin);const p={name:"p2wsh",network:f};if(h.prop(p,"address",(()=>{if(!p.hash)return;const e=s.bech32.toWords(p.hash);return e.unshift(0),s.bech32.encode(f.bech32,e)})),h.prop(p,"hash",(()=>e.output?e.output.subarray(2):e.address?r().data:p.redeem&&p.redeem.output?o.sha256(p.redeem.output):void 0)),h.prop(p,"output",(()=>{if(p.hash)return u.compile([l.OP_0,p.hash])})),h.prop(p,"redeem",(()=>{if(e.witness)return{output:e.witness[e.witness.length-1],input:d,witness:e.witness.slice(0,-1)}})),h.prop(p,"input",(()=>{if(p.witness)return d})),h.prop(p,"witness",(()=>{if(e.redeem&&e.redeem.input&&e.redeem.input.length>0&&e.redeem.output&&e.redeem.output.length>0){const t=u.toStack(i());return p.redeem=Object.assign({witness:t},e.redeem),p.redeem.input=d,[].concat(t,e.redeem.output)}if(e.redeem&&e.redeem.output&&e.redeem.witness)return[].concat(e.redeem.witness,e.redeem.output)})),h.prop(p,"name",(()=>{const e=["p2wsh"];return void 0!==p.redeem&&void 0!==p.redeem.name&&e.push(p.redeem.name),e.join("-")})),t.validate){let t=Buffer.from([]);if(e.address){const{prefix:e,version:i,data:n}=r();if(e!==f.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==i)throw new TypeError("Invalid address version");if(32!==n.length)throw new TypeError("Invalid address data");t=n}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(34!==e.output.length||e.output[0]!==l.OP_0||32!==e.output[1])throw new TypeError("Output is invalid");const r=e.output.subarray(2);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.redeem){if(e.redeem.network&&e.redeem.network!==f)throw new TypeError("Network mismatch");if(e.redeem.input&&e.redeem.input.length>0&&e.redeem.witness&&e.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(e.redeem.output){if(0===u.decompile(e.redeem.output).length)throw new TypeError("Redeem.output is invalid");const r=o.sha256(e.redeem.output);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.redeem.input&&!u.isPushOnly(i()))throw new TypeError("Non push-only scriptSig");if(e.witness&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.witness,e.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(e.redeem.input&&i().some(c)||e.redeem.output&&(u.decompile(e.redeem.output)||[]).some(c))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(e.witness&&e.witness.length>0){const t=e.witness[e.witness.length-1];if(e.redeem&&e.redeem.output&&!e.redeem.output.equals(t))throw new TypeError("Witness and redeem.output mismatch");if(e.witness.some(c)||(u.decompile(t)||[]).some(c))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(p,e)}},"../utxo-lib/lib/payments/sstxchange.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.sstxchange=void 0;const i=r("../../node_modules/typeforce/index.js"),n=r("../utxo-lib/lib/bs58check.js"),s=r("../utxo-lib/lib/networks.js"),o=r("../utxo-lib/lib/script/index.js"),a=r("../utxo-lib/lib/payments/lazy.js"),{OPS:u}=o;t.sstxchange=function(e,t){if(!e.address&&!e.hash&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),i({network:i.maybe(i.Object),address:i.maybe(i.String),hash:i.maybe(i.BufferN(20)),output:i.maybe(i.Buffer)},e);const r=a.value((()=>n.decodeAddress(e.address,e.network))),h=e.network||s.decred,l={name:"sstxchange",network:h};if(a.prop(l,"address",(()=>{if(l.hash)return n.encodeAddress(l.hash,h.pubKeyHash,h)})),a.prop(l,"hash",(()=>e.output?e.output.subarray(4,24):e.address?r().hash:void 0)),a.prop(l,"output",(()=>{if(l.hash)return o.compile([u.OP_SSTXCHANGE,u.OP_DUP,u.OP_HASH160,l.hash,u.OP_EQUALVERIFY,u.OP_CHECKSIG])})),t.validate){let t=Buffer.from([]);if(e.address){const{version:e,hash:i}=r();if(e!==h.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==i.length)throw new TypeError("Invalid address");t=i}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(26!==e.output.length||e.output[0]!==u.OP_SSTXCHANGE||e.output[1]!==u.OP_DUP||e.output[2]!==u.OP_HASH160||20!==e.output[3]||e.output[24]!==u.OP_EQUALVERIFY||e.output[25]!==u.OP_CHECKSIG)throw new TypeError("sstxchange output is invalid");const r=e.output.subarray(4,24);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch")}}return Object.assign(l,e)}},"../utxo-lib/lib/payments/sstxcommitment.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.sstxcommitment=void 0;const i=r("../../node_modules/typeforce/index.js"),n=r("../utxo-lib/lib/bufferutils.js"),s=r("../utxo-lib/lib/bs58check.js"),o=r("../utxo-lib/lib/networks.js"),a=r("../utxo-lib/lib/script/index.js"),u=r("../utxo-lib/lib/payments/lazy.js"),{OPS:h}=a;t.sstxcommitment=function(e,t){if(!(e.address||e.amount||e.hash||e.output))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),i({network:i.maybe(i.Object),address:i.maybe(i.String),amount:i.maybe(i.String),hash:i.maybe(i.BufferN(20)),output:i.maybe(i.Buffer)},e);const r=u.value((()=>s.decodeAddress(e.address,e.network))),l=e.network||o.decred,d={name:"sstxcommitment",network:l};if(u.prop(d,"address",(()=>{if(d.hash)return s.encodeAddress(d.hash,l.pubKeyHash,l)})),u.prop(d,"hash",(()=>e.output?e.output.subarray(2,22):e.address?r().hash:void 0)),u.prop(d,"output",(()=>{if(!d.hash||!e.amount)return;const t=Buffer.allocUnsafe(d.hash.length+10),r=new n.BufferWriter(t);return r.writeSlice(d.hash),r.writeUInt64(e.amount),r.writeUInt8(0),r.writeUInt8(88),a.compile([h.OP_RETURN,t])})),t.validate){let t=Buffer.from([]);if(e.address){const{version:e,hash:i}=r();if(e!==l.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==i.length)throw new TypeError("Invalid address");t=i}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(32!==e.output.length||e.output[0]!==h.OP_RETURN)throw new TypeError("sstxcommitment output is invalid");const r=e.output.subarray(2,22);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch")}}return Object.assign(d,e)}},"../utxo-lib/lib/payments/sstxpkh.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.sstxpkh=void 0;const i=r("../../node_modules/typeforce/index.js"),n=r("../utxo-lib/lib/bs58check.js"),s=r("../utxo-lib/lib/networks.js"),o=r("../utxo-lib/lib/script/index.js"),a=r("../utxo-lib/lib/payments/lazy.js"),{OPS:u}=o;t.sstxpkh=function(e,t){if(!e.address&&!e.hash&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),i({network:i.maybe(i.Object),address:i.maybe(i.String),hash:i.maybe(i.BufferN(20)),output:i.maybe(i.Buffer)},e);const r=a.value((()=>n.decodeAddress(e.address,e.network))),h=e.network||s.decred,l={name:"sstxpkh",network:h};if(a.prop(l,"address",(()=>{if(l.hash)return n.encodeAddress(l.hash,h.pubKeyHash,h)})),a.prop(l,"hash",(()=>e.output?e.output.subarray(4,24):e.address?r().hash:void 0)),a.prop(l,"output",(()=>{if(l.hash)return o.compile([u.OP_SSTX,u.OP_DUP,u.OP_HASH160,l.hash,u.OP_EQUALVERIFY,u.OP_CHECKSIG])})),t.validate){let t=Buffer.from([]);if(e.address){const{version:e,hash:i}=r();if(e!==h.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==i.length)throw new TypeError("Invalid address");t=i}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(26!==e.output.length||e.output[0]!==u.OP_SSTX||e.output[1]!==u.OP_DUP||e.output[2]!==u.OP_HASH160||20!==e.output[3]||e.output[24]!==u.OP_EQUALVERIFY||e.output[25]!==u.OP_CHECKSIG)throw new TypeError("sstxpkh output is invalid");const r=e.output.subarray(4,24);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch")}}return Object.assign(l,e)}},"../utxo-lib/lib/payments/sstxsh.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.sstxsh=void 0;const i=r("../../node_modules/typeforce/index.js"),n=r("../utxo-lib/lib/bs58check.js"),s=r("../utxo-lib/lib/networks.js"),o=r("../utxo-lib/lib/script/index.js"),a=r("../utxo-lib/lib/payments/lazy.js"),{OPS:u}=o;t.sstxsh=function(e,t){if(!e.address&&!e.hash&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),i({network:i.maybe(i.Object),address:i.maybe(i.String),hash:i.maybe(i.BufferN(20)),output:i.maybe(i.Buffer)},e);const r=e.network||s.decred,h={name:"sstxsh",network:r},l=a.value((()=>n.decodeAddress(e.address,r)));if(a.prop(h,"address",(()=>{if(h.hash)return n.encodeAddress(h.hash,r.scriptHash,r)})),a.prop(h,"hash",(()=>e.output?e.output.subarray(3,23):e.address?l().hash:void 0)),a.prop(h,"output",(()=>{if(h.hash)return o.compile([u.OP_SSTX,u.OP_HASH160,h.hash,u.OP_EQUAL])})),t.validate){let t=Buffer.from([]);if(e.address){const{version:e,hash:i}=l();if(e!==r.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==i.length)throw new TypeError("Invalid address");t=i}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(24!==e.output.length||e.output[0]!==u.OP_SSTX||e.output[1]!==u.OP_HASH160||20!==e.output[2]||e.output[23]!==u.OP_EQUAL)throw new TypeError("sstxsh output is invalid");const r=e.output.subarray(3,23);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch")}}return Object.assign(h,e)}},"../utxo-lib/lib/script/index.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.OPS=t.signature=t.number=t.isCanonicalScriptSignature=t.isDefinedHashType=t.isCanonicalPubKey=t.toStack=t.fromASM=t.toASM=t.decompile=t.compile=t.isPushOnly=void 0;const i=r("../../node_modules/bip66/index.js"),n=r("../../node_modules/pushdata-bitcoin/index.js"),s=r("../../node_modules/typeforce/index.js"),o=r("../../node_modules/tiny-secp256k1/js.js"),a=r("../utxo-lib/lib/script/scriptNumber.js"),u=r("../utxo-lib/lib/script/scriptSignature.js"),h=r("../utxo-lib/lib/script/ops.js"),l=r("../utxo-lib/lib/types/index.js"),d=h.OPS.OP_RESERVED;function c(e){return l.Buffer(e)||function(e){return l.Number(e)&&(e===h.OPS.OP_0||e>=h.OPS.OP_1&&e<=h.OPS.OP_16||e===h.OPS.OP_1NEGATE)}(e)}function f(e){return l.Array(e)&&e.every(c)}function p(e){return 0===e.length?h.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?d+e[0]:129===e[0]?h.OPS.OP_1NEGATE:void 0:void 0}function m(e){if(l.Buffer(e))return e;s(l.Array,e);const t=e.reduce(((e,t)=>l.Buffer(t)?1===t.length&&void 0!==p(t)?e+1:e+n.encodingLength(t.length)+t.length:e+1),0),r=Buffer.allocUnsafe(t);let i=0;if(e.forEach((e=>{if(l.Buffer(e)){const t=p(e);if(void 0!==t)return r.writeUInt8(t,i),void(i+=1);i+=n.encode(r,e.length,i),e.copy(r,i),i+=e.length}else r.writeUInt8(e,i),i+=1})),i!==r.length)throw new Error("Could not decode chunks");return r}function b(e){if(l.Array(e))return e;s(l.Buffer,e);const t=[];let r=0;for(;rh.OPS.OP_0&&i<=h.OPS.OP_PUSHDATA4){const i=n.decode(e,r);if(null===i)return[];if(r+=i.size,r+i.number>e.length)return[];const s=e.subarray(r,r+i.number);r+=i.number;const o=p(s);void 0!==o?t.push(o):t.push(s)}else t.push(i),r+=1}return t}function g(e){const t=-129&e;return t>0&&t<4}t.isPushOnly=f,t.compile=m,t.decompile=b,t.toASM=function(e){return l.Buffer(e)&&(e=b(e)),e.map((e=>{if(l.Buffer(e)){const t=p(e);if(void 0===t)return e.toString("hex");e=t}return h.REVERSE_OPS[e]})).join(" ")},t.fromASM=function(e){return s(l.String,e),m(e.split(" ").map((e=>void 0!==h.OPS[e]?h.OPS[e]:(s(l.Hex,e),Buffer.from(e,"hex")))))},t.toStack=function(e){const t=b(e);return s(f,t),null==t?void 0:t.map((e=>l.Buffer(e)?e:e===h.OPS.OP_0?Buffer.allocUnsafe(0):a.encode(e-d)))},t.isCanonicalPubKey=function(e){return o.isPoint(e)},t.isDefinedHashType=g,t.isCanonicalScriptSignature=function(e){return!!l.Buffer(e)&&(!!g(e[e.length-1])&&i.check(e.subarray(0,-1)))},t.number=a,t.signature=u;var y=r("../utxo-lib/lib/script/ops.js");Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return y.OPS}})},"../utxo-lib/lib/script/ops.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REVERSE_OPS=t.OPS=void 0;const i=r("../../node_modules/bitcoin-ops/index.json"),n=Object.assign({OP_SSTX:186,OP_SSTXCHANGE:189,OP_SSGEN:187,OP_SSRTX:188},i||{});t.OPS=n;const s=[];t.REVERSE_OPS=s,Object.keys(n).forEach((e=>{s[n[e]]=e}))},"../utxo-lib/lib/script/scriptNumber.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.decode=void 0,t.decode=function(e,t=4,r=!0){const{length:i}=e;if(0===i)return 0;if(i>t)throw new TypeError("Script number overflow");if(r&&0==(127&e[i-1])&&(i<=1||0==(128&e[i-2])))throw new Error("Non-minimally encoded script number");if(5===i){const t=e.readUInt32LE(0),r=e.readUInt8(4);return 128&r?-(4294967296*(-129&r)+t):4294967296*r+t}let n=0;for(let t=0;t2147483647?5:i>8388607?4:i>32767?3:i>127?2:i>0?1:0;var i;const n=Buffer.allocUnsafe(r),s=e<0;for(let e=0;e>=8;return 128&n[r-1]?n.writeUInt8(s?128:0,r-1):s&&(n[r-1]|=128),n}},"../utxo-lib/lib/script/scriptSignature.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.decode=t.fromDER=t.toDER=void 0;const i=r("../../node_modules/bip66/index.js"),n=r("../../node_modules/typeforce/index.js"),s=r("../utxo-lib/lib/types/index.js"),o=Buffer.alloc(1,0);function a(e){let t=0;for(;0===e[t];)++t;return t===e.length?o:128&(e=e.subarray(t))[0]?Buffer.concat([o,e],1+e.length):e}function u(e){0===e[0]&&(e=e.subarray(1));const t=Buffer.alloc(32,0),r=Math.max(0,32-e.length);return e.copy(t,r),t}t.toDER=a,t.fromDER=u,t.decode=function(e){const t=e.readUInt8(e.length-1),r=-129&t;if(r<=0||r>=4)throw new Error(`Invalid hashType ${t}`);const n=i.decode(e.subarray(0,-1)),s=u(n.r),o=u(n.s);return{signature:Buffer.concat([s,o],64),hashType:t}},t.encode=function(e,t){n({signature:s.BufferN(64),hashType:s.UInt8},{signature:e,hashType:t});const r=-129&t;if(r<=0||r>=4)throw new Error(`Invalid hashType ${t}`);const o=Buffer.allocUnsafe(1);o.writeUInt8(t,0);const u=a(e.subarray(0,32)),h=a(e.subarray(32,64));return Buffer.concat([i.encode(u,h),o])}},"../utxo-lib/lib/transaction/base.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBase=t.EMPTY_SCRIPT=t.isCoinbaseHash=t.vectorSize=t.varSliceSize=void 0;const i=r("../../node_modules/varuint-bitcoin/index.js"),n=r("../../node_modules/typeforce/index.js"),s=r("../utxo-lib/lib/bufferutils.js"),o=r("../utxo-lib/lib/crypto.js"),a=r("../utxo-lib/lib/types/index.js"),u=r("../utxo-lib/lib/script/index.js"),h=r("../utxo-lib/lib/networks.js");function l(e){const{length:t}=e;return i.encodingLength(t)+t}function d(e){return i.encodingLength(e.length)+e.reduce(((e,t)=>e+l(t)),0)}function c(e){n(a.Hash256bit,e);for(let t=0;t<32;++t)if(0!==e[t])return!1;return!0}t.varSliceSize=l,t.vectorSize=d,t.isCoinbaseHash=c,t.EMPTY_SCRIPT=Buffer.allocUnsafe(0);t.TransactionBase=class{constructor(e){this.version=1,this.locktime=0,this.ins=[],this.outs=[],this.network=e.network||h.bitcoin,this.specific=e.txSpecific}isCoinbase(){return 1===this.ins.length&&c(this.ins[0].hash)}hasWitnesses(){return this.ins.some((e=>0!==e.witness.length))}isMwebPegOutTx(){return!!(0,h.isNetworkType)("litecoin",this.network)&&(this.outs.some((e=>u.toASM(e.script).startsWith("OP_8")))&&this.ins.some((e=>!e.script.length)))}weight(){return 3*this.byteLength(!1,!1)+this.byteLength(!0,!1)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(e=!0,t=!0){const r=e&&this.hasWitnesses();return(r?10:8)+(this.timestamp?4:0)+i.encodingLength(this.ins.length)+i.encodingLength(this.outs.length)+this.ins.reduce(((e,t)=>e+40+l(t.script)),0)+this.outs.reduce(((e,t)=>e+8+l(t.script)),0)+(r?this.ins.reduce(((e,t)=>e+d(t.witness)),0):0)+(t&&this.isMwebPegOutTx()?3:0)}getHash(e=!1,t=!1){return e&&this.isCoinbase()?Buffer.alloc(32,0):o.hash256(this.toBuffer(void 0,void 0,e,t))}getId(){return(0,s.reverseBuffer)(this.getHash(!1)).toString("hex")}getWitness(e){if(!this.hasWitnesses()||!this.ins[e]||!Array.isArray(this.ins[e].witness)||this.ins[e].witness.length<1)return;const{witness:t}=this.ins[e],r=t.reduce(((e,t)=>e.concat([(0,s.getChunkSize)(t.length),t])),[(0,s.getChunkSize)(t.length)]);return Buffer.concat(r)}getExtraData(){}getSpecificData(){return this.specific}toBuffer(e,r,i=!0,n=!0){return t.EMPTY_SCRIPT}toHex(){return this.toBuffer().toString("hex")}}},"../utxo-lib/lib/transaction/bitcoin.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromConstructor=void 0;const i=r("../utxo-lib/lib/bufferutils.js"),n=r("../utxo-lib/lib/networks.js"),s=r("../utxo-lib/lib/transaction/base.js"),o=0,a=1,u=8;function h(e,t,r,n=!0,s=!0){t||(t=Buffer.allocUnsafe(e.byteLength(n,s)));const h=new i.BufferWriter(t,r||0);h.writeInt32(e.version);const l=n&&e.hasWitnesses(),d=s&&e.isMwebPegOutTx();return l?(h.writeUInt8(o),h.writeUInt8(a)):d&&(h.writeUInt8(o),h.writeUInt8(u)),h.writeVarInt(e.ins.length),e.ins.forEach((e=>{h.writeSlice(e.hash),h.writeUInt32(e.index),h.writeVarSlice(e.script),h.writeUInt32(e.sequence)})),h.writeVarInt(e.outs.length),e.outs.forEach((e=>{h.writeUInt64(e.value),h.writeVarSlice(e.script)})),l&&e.ins.forEach((e=>{h.writeVector(e.witness)})),d&&h.writeUInt8(0),h.writeUInt32(e.locktime),void 0!==r?t.subarray(r,h.offset):t}function l(e){const t=new s.TransactionBase(e);return t.toBuffer=h.bind(null,t),t}t.fromConstructor=l,t.fromBuffer=function(e,t){const r=new i.BufferReader(e),s=l(t);s.version=r.readInt32();const h=r.readUInt8(),d=r.readUInt8();let c=!1,f=!1;(0,n.isNetworkType)("litecoin",s.network)&&h===o&&d===u&&(f=!0),h===o&&d===a?c=!0:f||(r.offset-=2);const p=r.readVarInt();for(let e=0;e{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromConstructor=void 0;const i=r("../../node_modules/varuint-bitcoin/index.js"),n=r("../utxo-lib/lib/bufferutils.js"),s=r("../utxo-lib/lib/transaction/base.js"),o=0;function a(e,t=!0){var r;const n=t&&e.hasWitnesses();return(n?10:8)+(e.timestamp?4:0)+i.encodingLength(e.ins.length)+i.encodingLength(e.outs.length)+e.ins.reduce(((e,t)=>e+40+(0,s.varSliceSize)(t.script)),0)+e.outs.reduce(((e,t)=>e+8+(0,s.varSliceSize)(t.script)),0)+((null===(r=e.specific)||void 0===r?void 0:r.extraPayload)?(0,s.varSliceSize)(e.specific.extraPayload):0)+(n?e.ins.reduce(((e,t)=>e+(0,s.vectorSize)(t.witness)),0):0)}function u(e,t,r,i=!0){var s;t||(t=Buffer.allocUnsafe(e.byteLength(i)));const a=new n.BufferWriter(t,r||0);return e.version>=3&&e.type!==o?(a.writeUInt16(e.version),a.writeUInt16(e.type)):a.writeInt32(e.version),a.writeVarInt(e.ins.length),e.ins.forEach((e=>{a.writeSlice(e.hash),a.writeUInt32(e.index),a.writeVarSlice(e.script),a.writeUInt32(e.sequence)})),a.writeVarInt(e.outs.length),e.outs.forEach((e=>{a.writeUInt64(e.value),a.writeVarSlice(e.script)})),a.writeUInt32(e.locktime),(null===(s=e.specific)||void 0===s?void 0:s.extraPayload)&&a.writeVarSlice(e.specific.extraPayload),void 0!==r?t.subarray(r,a.offset):t}function h(e){var t;if(!(null===(t=e.specific)||void 0===t?void 0:t.extraPayload))return;const r=i.encode(e.specific.extraPayload.length);return Buffer.concat([r,e.specific.extraPayload])}function l(e){const t=new s.TransactionBase(e);return t.specific=t.specific||{type:"dash"},t.byteLength=a.bind(null,t),t.toBuffer=u.bind(null,t),t.getExtraData=h.bind(null,t),t}t.fromConstructor=l,t.fromBuffer=function(e,t){const r=new n.BufferReader(e),i=l(t);if(i.version=r.readInt32(),i.type=i.version>>16,i.version&=65535,3===i.version&&(i.type6))throw new Error("Unsupported Dash transaction type");const s=r.readVarInt();for(let e=0;e=3&&i.type!==o&&(i.specific.extraPayload=r.readVarSlice()),t.nostrict)return i;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return i}},"../utxo-lib/lib/transaction/decred.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromConstructor=void 0;const i=r("../../node_modules/varuint-bitcoin/index.js"),n=r("../utxo-lib/lib/bufferutils.js"),s=r("../utxo-lib/lib/crypto.js"),o=r("../utxo-lib/lib/transaction/base.js"),a=0,u=1;function h(e){return e.type===a}function l(e,t=!0){let r=4+i.encodingLength(e.ins.length),n=0;const s=t&&e.hasWitnesses();return r+=e.ins.reduce(((e,t)=>(e+=41,s&&(n+=1,e+=16,e+=(0,o.varSliceSize)(t.decredWitness.script)),e)),0),s&&(r+=i.encodingLength(n)),r+=i.encodingLength(e.outs.length),r+=e.outs.reduce(((e,t)=>(e+=10,e+=(0,o.varSliceSize)(t.script))),0),r+=8,r}function d(e,t,r,i=!0){t||(t=Buffer.allocUnsafe(l(e,i)));const s=new n.BufferWriter(t,r||0);return s.writeUInt16(e.version),s.writeUInt16(i?e.type:u),s.writeVarInt(e.ins.length),e.ins.forEach((e=>{s.writeSlice(e.hash),s.writeUInt32(e.index),s.writeUInt8(e.decredTree),s.writeUInt32(e.sequence)})),s.writeVarInt(e.outs.length),e.outs.forEach((e=>{s.writeUInt64(e.value),s.writeUInt16(e.decredVersion),s.writeVarSlice(e.script)})),s.writeUInt32(e.locktime),s.writeUInt32(e.expiry),i&&e.hasWitnesses()&&(s.writeVarInt(e.ins.length),e.ins.forEach((e=>{s.writeUInt64(e.decredWitness.value),s.writeUInt32(e.decredWitness.height),s.writeUInt32(e.decredWitness.blockIndex),s.writeVarSlice(e.decredWitness.script)}))),void 0!==r?t.subarray(r,s.offset):t}function c(e,t=!1){return t&&e.isCoinbase()?Buffer.alloc(32,0):s.blake256(d(e,void 0,void 0,t))}function f(e){return e.byteLength(!0)}function p(e){const t=new o.TransactionBase(e);return t.byteLength=l.bind(null,t),t.toBuffer=d.bind(null,t),t.hasWitnesses=h.bind(null,t),t.getHash=c.bind(null,t),t.weight=f.bind(null,t),t}t.fromConstructor=p,t.fromBuffer=function(e,t){const r=new n.BufferReader(e),i=p(t);if(i.version=r.readInt32(),i.type=i.version>>16,i.version&=65535,1!==i.version)throw new Error("Unsupported Decred transaction version");if(i.type!==a&&i.type!==u)throw new Error("Unsupported Decred transaction type");const s=r.readVarInt();for(let e=0;e{e.decredWitness={value:r.readUInt64String(),height:r.readUInt32(),blockIndex:r.readUInt32(),script:r.readVarSlice()}}))}if(t.nostrict)return i;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return i}},"../utxo-lib/lib/transaction/index.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;const i=r("../utxo-lib/lib/networks.js"),n=r("../utxo-lib/lib/transaction/base.js"),s=r("../utxo-lib/lib/transaction/bitcoin.js"),o=r("../utxo-lib/lib/transaction/dash.js"),a=r("../utxo-lib/lib/transaction/decred.js"),u=r("../utxo-lib/lib/transaction/peercoin.js"),h=r("../utxo-lib/lib/transaction/zcash.js");class l extends n.TransactionBase{constructor(e={}){return super(e),(0,i.isNetworkType)("dash",this.network)?o.fromConstructor(e):(0,i.isNetworkType)("decred",this.network)?a.fromConstructor(e):(0,i.isNetworkType)("peercoin",this.network)?u.fromConstructor(e):(0,i.isNetworkType)("zcash",this.network)?h.fromConstructor(e):s.fromConstructor(e)}static isCoinbaseHash(e){return(0,n.isCoinbaseHash)(e)}static fromBuffer(e,t={}){return(0,i.isNetworkType)("dash",t.network)?o.fromBuffer(e,t):(0,i.isNetworkType)("decred",t.network)?a.fromBuffer(e,t):(0,i.isNetworkType)("peercoin",t.network)?u.fromBuffer(e,t):(0,i.isNetworkType)("zcash",t.network)?h.fromBuffer(e,t):s.fromBuffer(e,t)}static fromHex(e,t={}){return this.fromBuffer(Buffer.from(e,"hex"),Object.assign(t,{nostrict:!1}))}}t.Transaction=l},"../utxo-lib/lib/transaction/peercoin.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromConstructor=void 0;const i=r("../utxo-lib/lib/bufferutils.js"),n=r("../utxo-lib/lib/transaction/base.js");function s(e,t,r){t||(t=Buffer.allocUnsafe(e.byteLength(!1)));const n=new i.BufferWriter(t,r||0);return n.writeInt32(e.version),n.writeUInt32(e.timestamp),n.writeVarInt(e.ins.length),e.ins.forEach((e=>{n.writeSlice(e.hash),n.writeUInt32(e.index),n.writeVarSlice(e.script),n.writeUInt32(e.sequence)})),n.writeVarInt(e.outs.length),e.outs.forEach((e=>{n.writeUInt64(e.value),n.writeVarSlice(e.script)})),n.writeUInt32(e.locktime),void 0!==r?t.subarray(r,n.offset):t}function o(e){const t=new n.TransactionBase(e);return t.toBuffer=s.bind(null,t),t}t.fromConstructor=o,t.fromBuffer=function(e,t){const r=new i.BufferReader(e),n=o(t);n.version=r.readInt32(),n.timestamp=r.readUInt32();const s=r.readVarInt();for(let e=0;e{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromConstructor=void 0;const i=r("../../node_modules/varuint-bitcoin/index.js"),n=r("../../node_modules/blakejs/index.js"),s=r("../utxo-lib/lib/bufferutils.js"),o=r("../utxo-lib/lib/transaction/base.js"),a=r("../utxo-lib/lib/crypto.js"),u=2,h=3,l=4,d=5,c=2,f=10;function p(e){const t=e.version>=h?8:0,r=e.specific,n=e.version===l?8+i.encodingLength(r.vShieldedSpend.length)+384*r.vShieldedSpend.length+i.encodingLength(r.vShieldedOutput.length)+948*r.vShieldedOutput.length+(r.vShieldedSpend.length+r.vShieldedOutput.length>0?64:0):0,a=e.version>=d?7:0;return 4+i.encodingLength(e.ins.length)+i.encodingLength(e.outs.length)+e.ins.reduce(((e,t)=>e+40+(0,o.varSliceSize)(t.script)),0)+e.outs.reduce(((e,t)=>e+8+(0,o.varSliceSize)(t.script)),0)+4+t+(()=>{if(e.version=d)return 0;const t=r.joinsplits.length;return t<1?(0,s.varIntSize)(t):(0,s.varIntSize)(t)+(e.version>=l?1698*t:1802*t)+32+64})()+n+a}function m(e,t,r){t||(t=Buffer.allocUnsafe(p(e)));const i=new s.BufferWriter(t,r||0),n=e.specific;if(e.version>=h){const t=n.overwintered?1:0;i.writeInt32(e.version|t<<31),i.writeUInt32(n.versionGroupId)}else i.writeInt32(e.version);function o(e){i.writeUInt8(c|e.yLsb),i.writeSlice(e.x)}return e.version>=d&&(i.writeUInt32(n.consensusBranchId),i.writeUInt32(e.locktime),i.writeUInt32(e.expiry)),i.writeVarInt(e.ins.length),e.ins.forEach((e=>{i.writeSlice(e.hash),i.writeUInt32(e.index),i.writeVarSlice(e.script),i.writeUInt32(e.sequence)})),i.writeVarInt(e.outs.length),e.outs.forEach((e=>{i.writeUInt64(e.value),i.writeVarSlice(e.script)})),e.version=h&&i.writeUInt32(e.expiry)),e.version===l&&(i.writeInt64(n.valueBalance),i.writeVarInt(n.vShieldedSpend.length),n.vShieldedSpend.forEach((e=>{i.writeSlice(e.cv),i.writeSlice(e.anchor),i.writeSlice(e.nullifier),i.writeSlice(e.rk),i.writeSlice(e.zkproof.sA),i.writeSlice(e.zkproof.sB),i.writeSlice(e.zkproof.sC),i.writeSlice(e.spendAuthSig)})),i.writeVarInt(n.vShieldedOutput.length),n.vShieldedOutput.forEach((e=>{i.writeSlice(e.cv),i.writeSlice(e.cmu),i.writeSlice(e.ephemeralKey),i.writeSlice(e.encCiphertext),i.writeSlice(e.outCiphertext),i.writeSlice(e.zkproof.sA),i.writeSlice(e.zkproof.sB),i.writeSlice(e.zkproof.sC)}))),e.version>=u&&e.version{var t;i.writeUInt64(e.vpubOld),i.writeUInt64(e.vpubNew),i.writeSlice(e.anchor),e.nullifiers.forEach((e=>{i.writeSlice(e)})),e.commitments.forEach((e=>{i.writeSlice(e)})),i.writeSlice(e.ephemeralKey),i.writeSlice(e.randomSeed),e.macs.forEach((e=>{i.writeSlice(e)})),"sapling"===e.zkproof.type?(i.writeSlice(e.zkproof.sA),i.writeSlice(e.zkproof.sB),i.writeSlice(e.zkproof.sC)):(o(e.zkproof.gA),o(e.zkproof.gAPrime),t=e.zkproof.gB,i.writeUInt8(f|t.yLsb),i.writeSlice(t.x),o(e.zkproof.gBPrime),o(e.zkproof.gC),o(e.zkproof.gCPrime),o(e.zkproof.gK),o(e.zkproof.gH)),e.ciphertexts.forEach((e=>{i.writeSlice(e)}))})),n.joinsplits.length>0&&(i.writeSlice(n.joinsplitPubkey),i.writeSlice(n.joinsplitSig))),e.version>=l&&n.vShieldedSpend.length+n.vShieldedOutput.length>0&&i.writeSlice(n.bindingSig),e.version===d&&(i.writeVarInt(0),i.writeVarInt(0),i.writeUInt8(0)),void 0!==r?t.subarray(r,i.offset):t}function b(e){if(e.version=d)return;const t=4+(e.version>=h?8:0)+i.encodingLength(e.ins.length)+i.encodingLength(e.outs.length)+e.ins.reduce(((e,t)=>e+40+(0,o.varSliceSize)(t.script)),0)+e.outs.reduce(((e,t)=>e+8+(0,o.varSliceSize)(t.script)),0)+4;return e.toBuffer().subarray(t)}function g(e,t){const r=(0,n.blake2b)(e,void 0,32,void 0,Buffer.from(t));return Buffer.from(r)}function y(e){let t;if(e.ins.length||e.outs.length){const r=new s.BufferWriter(Buffer.alloc(96));r.writeSlice(function(e){const t=new s.BufferWriter(Buffer.allocUnsafe(36*e.length));return e.forEach((e=>{t.writeSlice(e.hash),t.writeUInt32(e.index)})),g(t.buffer,"ZTxIdPrevoutHash")}(e.ins)),r.writeSlice(function(e){const t=new s.BufferWriter(Buffer.allocUnsafe(4*e.length));return e.forEach((e=>{t.writeUInt32(e.sequence)})),g(t.buffer,"ZTxIdSequencHash")}(e.ins)),r.writeSlice(function(e){const t=e.reduce(((e,t)=>e+8+(0,o.varSliceSize)(t.script)),0),r=new s.BufferWriter(Buffer.allocUnsafe(t));return e.forEach((e=>{r.writeUInt64(e.value),r.writeVarSlice(e.script)})),g(r.buffer,"ZTxIdOutputsHash")}(e.outs)),t=r.buffer}else t=Buffer.of();return g(t,"ZTxIdTranspaHash")}function v(e,t=!1){if(e.version>>31,i.version&=2147483647,i.version>=h&&(n.versionGroupId=r.readUInt32()),i.version>=d&&(n.consensusBranchId=r.readUInt32(),i.locktime=r.readUInt32(),i.expiry=r.readUInt32());const o=r.readVarInt();for(let e=0;e=h?r.readUInt32():0),i.version===l){n.valueBalance=r.readInt64();const e=r.readVarInt();for(let t=0;t=u&&i.version=l?p():{type:"joinsplit",gA:c(),gAPrime:c(),gB:f(),gBPrime:c(),gC:c(),gCPrime:c(),gK:c(),gH:c()},g=[];for(e=0;e<2;e++)g.push(r.readSlice(601));n.joinsplits.push({vpubOld:t,vpubNew:s,anchor:o,nullifiers:a,commitments:u,ephemeralKey:h,randomSeed:d,macs:m,zkproof:b,ciphertexts:g})}e>0&&(n.joinsplitPubkey=r.readSlice(32),n.joinsplitSig=r.readSlice(64))}if(i.version>=l&&n.vShieldedSpend.length+n.vShieldedOutput.length>0&&(n.bindingSig=r.readSlice(64)),i.version===d){if(0!==r.readVarInt())throw Error("Unexpected vSpendsSapling vector");if(0!==r.readVarInt())throw Error("Unexpected vOutputsSapling vector");if(0!==r.readUInt8())throw Error("Unexpected orchard byte")}if(t.nostrict)return i;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return i}},"../utxo-lib/lib/types/coinselect.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../utxo-lib/lib/types/compose.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../utxo-lib/lib/types/index.js":function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r("../utxo-lib/lib/types/coinselect.js"),t),n(r("../utxo-lib/lib/types/compose.js"),t),n(r("../utxo-lib/lib/types/payments.js"),t),n(r("../utxo-lib/lib/types/typeforce.js"),t)},"../utxo-lib/lib/types/payments.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../utxo-lib/lib/types/typeforce.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.anyOf=t.Nil=t.BufferN=t.Function=t.UInt32=t.UInt16=t.UInt8=t.tuple=t.maybe=t.Hex=t.Buffer=t.String=t.Boolean=t.Array=t.Number=t.Hash256bit=t.Hash160bit=t.Buffer256bit=t.Satoshi=void 0;const i=r("../../node_modules/typeforce/index.js");t.Satoshi=function(e){return i.UInt53(e)&&e<=21e14},t.Buffer256bit=i.BufferN(32),t.Hash160bit=i.BufferN(20),t.Hash256bit=i.BufferN(32),t.Number=i.Number,t.Array=i.Array,t.Boolean=i.Boolean,t.String=i.String,t.Buffer=i.Buffer,t.Hex=i.Hex,t.maybe=i.maybe,t.tuple=i.tuple,t.UInt8=i.UInt8,t.UInt16=i.UInt16,t.UInt32=i.UInt32,t.Function=i.Function,t.BufferN=i.BufferN,t.Nil=i.Nil,t.anyOf=i.anyOf},"../../node_modules/base-x/src/index.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,l=new Uint8Array(o);e[r];){var d=t[e.charCodeAt(r)];if(255===d)return;for(var c=0,f=o-1;(0!==d||c>>0,l[f]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error("Non-zero carry");s=c,r++}for(var p=o-s;p!==o&&0===l[p];)p++;var m=i.allocUnsafe(n+(o-p));m.fill(0,0,n);for(var b=n;p!==o;)m[b++]=l[p++];return m}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,n=0,s=0,o=t.length;s!==o&&0===t[s];)s++,r++;for(var h=(o-s)*l+1>>>0,d=new Uint8Array(h);s!==o;){for(var c=t[s],f=0,p=h-1;(0!==c||f>>0,d[p]=c%a>>>0,c=c/a>>>0;if(0!==c)throw new Error("Non-zero carry");n=f,s++}for(var m=h-n;m!==h&&0===d[m];)m++;for(var b=u.repeat(r);m{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],i=t[1];return 3*(r+i)/4-i},t.toByteArray=function(e){var t,r,s=a(e),o=s[0],u=s[1],h=new n(function(e,t,r){return 3*(t+r)/4-r}(0,o,u)),l=0,d=u>0?o-4:o;for(r=0;r>16&255,h[l++]=t>>8&255,h[l++]=255&t;2===u&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,h[l++]=255&t);1===u&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,h[l++]=t>>8&255,h[l++]=255&t);return h},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],o=16383,a=0,h=i-n;ah?h:a+o));1===n?(t=e[i-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,i){for(var n,s,o=[],a=t;a>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},"../../node_modules/bchaddrjs/node_modules/bs58/index.js":(e,t,r)=>{var i=r("../../node_modules/base-x/src/index.js");e.exports=i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},"../../node_modules/bchaddrjs/node_modules/bs58check/base.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/bchaddrjs/node_modules/bs58/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e){function t(t){var r=t.slice(0,-4),i=t.slice(-4),n=e(r);if(!(i[0]^n[0]|i[1]^n[1]|i[2]^n[2]|i[3]^n[3]))return r}return{encode:function(t){var r=e(t);return i.encode(Buffer.concat([t,r],t.length+4))},decode:function(e){var r=t(i.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=i.decodeUnsafe(e);if(r)return t(r)}}}},"../../node_modules/bchaddrjs/node_modules/bs58check/index.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/create-hash/browser.js"),n=r("../../node_modules/bchaddrjs/node_modules/bs58check/base.js");e.exports=n((function(e){var t=i("sha256").update(e).digest();return i("sha256").update(t).digest()}))},"../../node_modules/bchaddrjs/src/bchaddr.js":(e,t,r)=>{ +/*** + * @license + * https://github.com/ealmansi/bchaddrjs + * Copyright (c) 2018-2020 Emilio Almansi + * Distributed under the MIT software license, see the accompanying + * file LICENSE or http://www.opensource.org/licenses/mit-license.php. + */ +var i=r("../../node_modules/bchaddrjs/node_modules/bs58check/index.js"),n=r("../../node_modules/cashaddrjs/src/cashaddr.js"),Buffer=r("../../node_modules/buffer/index.js").Buffer,s={Legacy:"legacy",Bitpay:"bitpay",Cashaddr:"cashaddr"},o={Mainnet:"mainnet",Testnet:"testnet"},a={};function u(e){return c(e).format}function h(e){return c(e).network}function l(e){return c(e).type}a.P2PKH="p2pkh",a.P2SH="p2sh";var d={};function c(e){try{return function(e){try{var t=i.decode(e);if(t.length!==f)throw new m;var r=t[0],n=Array.prototype.slice.call(t,1);switch(r){case d[s.Legacy][o.Mainnet][a.P2PKH]:return{hash:n,format:s.Legacy,network:o.Mainnet,type:a.P2PKH};case d[s.Legacy][o.Mainnet][a.P2SH]:return{hash:n,format:s.Legacy,network:o.Mainnet,type:a.P2SH};case d[s.Legacy][o.Testnet][a.P2PKH]:return{hash:n,format:s.Legacy,network:o.Testnet,type:a.P2PKH};case d[s.Legacy][o.Testnet][a.P2SH]:return{hash:n,format:s.Legacy,network:o.Testnet,type:a.P2SH};case d[s.Bitpay][o.Mainnet][a.P2PKH]:return{hash:n,format:s.Bitpay,network:o.Mainnet,type:a.P2PKH};case d[s.Bitpay][o.Mainnet][a.P2SH]:return{hash:n,format:s.Bitpay,network:o.Mainnet,type:a.P2SH}}}catch(e){}throw new m}(e)}catch(e){}try{return function(e){if(-1!==e.indexOf(":"))try{return p(e)}catch(e){}else for(var t=["bitcoincash","bchtest","bchreg"],r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bech32m=t.bech32=void 0;const r="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={};for(let e=0;e<32;e++){const t=r.charAt(e);i[t]=e}function n(e){const t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){let t=1;for(let r=0;r126)return"Invalid prefix ("+e+")";t=n(t)^i>>5}t=n(t);for(let r=0;r=r;)s-=r,a.push(n>>s&o);if(i)s>0&&a.push(n<=t)return"Excess padding";if(n<r)return"Exceeds length limit";const o=e.toLowerCase(),a=e.toUpperCase();if(e!==o&&e!==a)return"Mixed-case string "+e;const u=(e=o).lastIndexOf("1");if(-1===u)return"No separator character for "+e;if(0===u)return"Missing prefix for "+e;const h=e.slice(0,u),l=e.slice(u+1);if(l.length<6)return"Data too short";let d=s(h);if("string"==typeof d)return d;const c=[];for(let e=0;e=l.length||c.push(r)}return d!==t?"Invalid checksum for "+e:{prefix:h,words:c}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){const r=o(e,t);if("object"==typeof r)return r},decode:function(e,t){const r=o(e,t);if("object"==typeof r)return r;throw new Error(r)},encode:function(e,i,o){if(o=o||90,e.length+7+i.length>o)throw new TypeError("Exceeds length limit");let a=s(e=e.toLowerCase());if("string"==typeof a)throw new Error(a);let u=e+"1";for(let e=0;e>5!=0)throw new Error("Non 5-bit word");a=n(a)^t,u+=r.charAt(t)}for(let e=0;e<6;++e)a=n(a);a^=t;for(let e=0;e<6;++e){u+=r.charAt(a>>5*(5-e)&31)}return u},toWords:a,fromWordsUnsafe:u,fromWords:h}}t.bech32=l("bech32"),t.bech32m=l("bech32m")},"../../node_modules/bip66/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return 0!==r&&(6+t+r===e.length&&(!(128&e[4])&&(!(t>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))))))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,i=t.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var n=Buffer.allocUnsafe(6+r+i);return n[0]=48,n[1]=n.length-2,n[2]=2,n[3]=e.length,e.copy(n,4),n[4+r]=2,n[5+r]=t.length,t.copy(n,6+r),n}}},"../../node_modules/blake-hash/js.js":(e,t,r)=>{e.exports=r("../../node_modules/blake-hash/lib/api/index.js")(r("../../node_modules/blake-hash/lib/index.js"))},"../../node_modules/blake-hash/lib/api/blake.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer;const i=r("../../node_modules/readable-stream/readable-browser.js").Transform;e.exports=class extends i{constructor(e,t){super(t),this._engine=e,this._finalized=!1}_transform(e,t,r){let i=null;try{this.update(e,t)}catch(e){i=e}r(i)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._engine.update(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;let t=this._engine.digest();return void 0!==e&&(t=t.toString(e)),t}}},"../../node_modules/blake-hash/lib/api/index.js":(e,t,r)=>{const i=r("../../node_modules/blake-hash/lib/api/blake.js");e.exports=e=>(t,r)=>{const n=(t=>{switch("string"==typeof t?t.toLowerCase():t){case"blake224":return e.Blake224;case"blake256":return e.Blake256;case"blake384":return e.Blake384;case"blake512":return e.Blake512;default:throw new Error("Invald algorithm: "+t)}})(t);return new i(new n,r)}},"../../node_modules/blake-hash/lib/blake.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer;class i{_lengthCarry(e){for(let t=0;t=t.length;){for(let i=this._blockOffset;i{var Buffer=r("../../node_modules/buffer/index.js").Buffer;const i=r("../../node_modules/blake-hash/lib/blake256.js"),n=Buffer.from([0]),s=Buffer.from([128]);e.exports=class extends i{constructor(){super(),this._h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],this._zo=n,this._oo=s}digest(){this._padding();const e=Buffer.alloc(28);for(let t=0;t<7;++t)e.writeUInt32BE(this._h[t],4*t);return e}}},"../../node_modules/blake-hash/lib/blake256.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer;const i=r("../../node_modules/blake-hash/lib/blake.js"),n=Buffer.from([1]),s=Buffer.from([129]),o=(e,t)=>(e<<32-t|e>>>t)>>>0;function a(e,t,r,n,s,a,u,h){const l=i.sigma,d=i.u256;e[n]=e[n]+((t[l[r][h]]^d[l[r][h+1]])>>>0)+e[s]>>>0,e[u]=o(e[u]^e[n],16),e[a]=e[a]+e[u]>>>0,e[s]=o(e[s]^e[a],12),e[n]=e[n]+((t[l[r][h+1]]^d[l[r][h]])>>>0)+e[s]>>>0,e[u]=o(e[u]^e[n],8),e[a]=e[a]+e[u]>>>0,e[s]=o(e[s]^e[a],7)}e.exports=class extends i{constructor(){super(),this._h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this._s=[0,0,0,0],this._block=Buffer.alloc(64),this._blockOffset=0,this._length=[0,0],this._nullt=!1,this._zo=n,this._oo=s}_compress(){const e=i.u256,t=new Array(16),r=new Array(16);let n;for(n=0;n<16;++n)r[n]=this._block.readUInt32BE(4*n);for(n=0;n<8;++n)t[n]=this._h[n]>>>0;for(n=8;n<12;++n)t[n]=(this._s[n-8]^e[n-8])>>>0;for(n=12;n<16;++n)t[n]=e[n-8];for(this._nullt||(t[12]=(t[12]^this._length[0])>>>0,t[13]=(t[13]^this._length[0])>>>0,t[14]=(t[14]^this._length[1])>>>0,t[15]=(t[15]^this._length[1])>>>0),n=0;n<14;++n)a(t,r,n,0,4,8,12,0),a(t,r,n,1,5,9,13,2),a(t,r,n,2,6,10,14,4),a(t,r,n,3,7,11,15,6),a(t,r,n,0,5,10,15,8),a(t,r,n,1,6,11,12,10),a(t,r,n,2,7,8,13,12),a(t,r,n,3,4,9,14,14);for(n=0;n<16;++n)this._h[n%8]=(this._h[n%8]^t[n])>>>0;for(n=0;n<8;++n)this._h[n]=(this._h[n]^this._s[n%4])>>>0}_padding(){let e=this._length[0]+8*this._blockOffset,t=this._length[1];e>=4294967296&&(e-=4294967296,t+=1);const r=Buffer.alloc(8);r.writeUInt32BE(t,0),r.writeUInt32BE(e,4),55===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<55?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(55-this._blockOffset),this.update(i.padding.slice(0,55-this._blockOffset))):(this._length[0]-=8*(64-this._blockOffset),this.update(i.padding.slice(0,64-this._blockOffset)),this._length[0]-=440,this.update(i.padding.slice(1,56)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=64,this.update(r)}digest(){this._padding();const e=Buffer.alloc(32);for(let t=0;t<8;++t)e.writeUInt32BE(this._h[t],4*t);return e}}},"../../node_modules/blake-hash/lib/blake384.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer;const i=r("../../node_modules/blake-hash/lib/blake512.js"),n=Buffer.from([0]),s=Buffer.from([128]);e.exports=class extends i{constructor(){super(),this._h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428],this._zo=n,this._oo=s}digest(){this._padding();const e=Buffer.alloc(48);for(let t=0;t<12;++t)e.writeUInt32BE(this._h[t],4*t);return e}}},"../../node_modules/blake-hash/lib/blake512.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer;const i=r("../../node_modules/blake-hash/lib/blake.js"),n=Buffer.from([1]),s=Buffer.from([129]);function o(e,t,r,i){let n=e[2*t]^e[2*r],s=e[2*t+1]^e[2*r+1];i>=32&&(s^=n,n^=s,s^=n,i-=32),0===i?(e[2*t]=n>>>0,e[2*t+1]=s>>>0):(e[2*t]=(n>>>i|s<<32-i)>>>0,e[2*t+1]=(s>>>i|n<<32-i)>>>0)}function a(e,t,r,n,s,a,u,h){const l=i.sigma,d=i.u512;let c;c=e[2*n+1]+((t[2*l[r][h]+1]^d[2*l[r][h+1]+1])>>>0)+e[2*s+1],e[2*n]=e[2*n]+((t[2*l[r][h]]^d[2*l[r][h+1]])>>>0)+e[2*s]+~~(c/4294967296)>>>0,e[2*n+1]=c>>>0,o(e,u,n,32),c=e[2*a+1]+e[2*u+1],e[2*a]=e[2*a]+e[2*u]+~~(c/4294967296)>>>0,e[2*a+1]=c>>>0,o(e,s,a,25),c=e[2*n+1]+((t[2*l[r][h+1]+1]^d[2*l[r][h]+1])>>>0)+e[2*s+1],e[2*n]=e[2*n]+((t[2*l[r][h+1]]^d[2*l[r][h]])>>>0)+e[2*s]+~~(c/4294967296)>>>0,e[2*n+1]=c>>>0,o(e,u,n,16),c=e[2*a+1]+e[2*u+1],e[2*a]=e[2*a]+e[2*u]+~~(c/4294967296)>>>0,e[2*a+1]=c>>>0,o(e,s,a,11)}e.exports=class extends i{constructor(){super(),this._h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this._s=[0,0,0,0,0,0,0,0],this._block=Buffer.alloc(128),this._blockOffset=0,this._length=[0,0,0,0],this._nullt=!1,this._zo=n,this._oo=s}_compress(){const e=i.u512,t=new Array(32),r=new Array(32);let n;for(n=0;n<32;++n)r[n]=this._block.readUInt32BE(4*n);for(n=0;n<16;++n)t[n]=this._h[n]>>>0;for(n=16;n<24;++n)t[n]=(this._s[n-16]^e[n-16])>>>0;for(n=24;n<32;++n)t[n]=e[n-16];for(this._nullt||(t[24]=(t[24]^this._length[1])>>>0,t[25]=(t[25]^this._length[0])>>>0,t[26]=(t[26]^this._length[1])>>>0,t[27]=(t[27]^this._length[0])>>>0,t[28]=(t[28]^this._length[3])>>>0,t[29]=(t[29]^this._length[2])>>>0,t[30]=(t[30]^this._length[3])>>>0,t[31]=(t[31]^this._length[2])>>>0),n=0;n<16;++n)a(t,r,n,0,4,8,12,0),a(t,r,n,1,5,9,13,2),a(t,r,n,2,6,10,14,4),a(t,r,n,3,7,11,15,6),a(t,r,n,0,5,10,15,8),a(t,r,n,1,6,11,12,10),a(t,r,n,2,7,8,13,12),a(t,r,n,3,4,9,14,14);for(n=0;n<16;++n)this._h[n%8*2]=(this._h[n%8*2]^t[2*n])>>>0,this._h[n%8*2+1]=(this._h[n%8*2+1]^t[2*n+1])>>>0;for(n=0;n<8;++n)this._h[2*n]=(this._h[2*n]^this._s[n%4*2])>>>0,this._h[2*n+1]=(this._h[2*n+1]^this._s[n%4*2+1])>>>0}_padding(){const e=this._length.slice();e[0]+=8*this._blockOffset,this._lengthCarry(e);const t=Buffer.alloc(16);for(let r=0;r<4;++r)t.writeUInt32BE(e[3-r],4*r);111===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<111?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(111-this._blockOffset),this.update(i.padding.slice(0,111-this._blockOffset))):(this._length[0]-=8*(128-this._blockOffset),this.update(i.padding.slice(0,128-this._blockOffset)),this._length[0]-=888,this.update(i.padding.slice(1,112)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=128,this.update(t)}digest(){this._padding();const e=Buffer.alloc(64);for(let t=0;t<16;++t)e.writeUInt32BE(this._h[t],4*t);return e}}},"../../node_modules/blake-hash/lib/index.js":(e,t,r)=>{e.exports={Blake224:r("../../node_modules/blake-hash/lib/blake224.js"),Blake256:r("../../node_modules/blake-hash/lib/blake256.js"),Blake384:r("../../node_modules/blake-hash/lib/blake384.js"),Blake512:r("../../node_modules/blake-hash/lib/blake512.js")}},"../../node_modules/blakejs/blake2b.js":(e,t,r)=>{const i=r("../../node_modules/blakejs/util.js");function n(e,t,r){const i=e[t]+e[r];let n=e[t+1]+e[r+1];i>=4294967296&&n++,e[t]=i,e[t+1]=n}function s(e,t,r,i){let n=e[t]+r;r<0&&(n+=4294967296);let s=e[t+1]+i;n>=4294967296&&s++,e[t]=n,e[t+1]=s}function o(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,i,o,a){const u=d[o],h=d[o+1],c=d[a],f=d[a+1];n(l,e,t),s(l,e,u,h);let p=l[i]^l[e],m=l[i+1]^l[e+1];l[i]=m,l[i+1]=p,n(l,r,i),p=l[t]^l[r],m=l[t+1]^l[r+1],l[t]=p>>>24^m<<8,l[t+1]=m>>>24^p<<8,n(l,e,t),s(l,e,c,f),p=l[i]^l[e],m=l[i+1]^l[e+1],l[i]=p>>>16^m<<16,l[i+1]=m>>>16^p<<16,n(l,r,i),p=l[t]^l[r],m=l[t+1]^l[r+1],l[t]=m>>>31^p<<1,l[t+1]=p>>>31^m<<1}const u=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),h=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),l=new Uint32Array(32),d=new Uint32Array(32);function c(e,t){let r=0;for(r=0;r<16;r++)l[r]=e.h[r],l[r+16]=u[r];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),r=0;r<32;r++)d[r]=o(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,h[16*r+0],h[16*r+1]),a(2,10,18,26,h[16*r+2],h[16*r+3]),a(4,12,20,28,h[16*r+4],h[16*r+5]),a(6,14,22,30,h[16*r+6],h[16*r+7]),a(0,10,20,30,h[16*r+8],h[16*r+9]),a(2,12,22,24,h[16*r+10],h[16*r+11]),a(4,14,16,26,h[16*r+12],h[16*r+13]),a(6,8,18,28,h[16*r+14],h[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^l[r]^l[r+16]}const f=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,t,r,i){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(i&&16!==i.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const n={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};f.fill(0),f[0]=e,t&&(f[1]=t.length),f[2]=1,f[3]=1,r&&f.set(r,32),i&&f.set(i,48);for(let e=0;e<16;e++)n.h[e]=u[e]^o(f,4*e);return t&&(m(n,t),n.c=128),n}function m(e,t){for(let r=0;r>2]>>8*(3&r);return t}function g(e,t,r,n,s){r=r||64,e=i.normalizeInput(e),n&&(n=i.normalizeInput(n)),s&&(s=i.normalizeInput(s));const o=p(r,t,n,s);return m(o,e),b(o)}e.exports={blake2b:g,blake2bHex:function(e,t,r,n,s){const o=g(e,t,r,n,s);return i.toHex(o)},blake2bInit:p,blake2bUpdate:m,blake2bFinal:b}},"../../node_modules/blakejs/blake2s.js":(e,t,r)=>{const i=r("../../node_modules/blakejs/util.js");function n(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function s(e,t,r,i,n,s){h[e]=h[e]+h[t]+n,h[i]=o(h[i]^h[e],16),h[r]=h[r]+h[i],h[t]=o(h[t]^h[r],12),h[e]=h[e]+h[t]+s,h[i]=o(h[i]^h[e],8),h[r]=h[r]+h[i],h[t]=o(h[t]^h[r],7)}function o(e,t){return e>>>t^e<<32-t}const a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),h=new Uint32Array(16),l=new Uint32Array(16);function d(e,t){let r=0;for(r=0;r<8;r++)h[r]=e.h[r],h[r+8]=a[r];for(h[12]^=e.t,h[13]^=e.t/4294967296,t&&(h[14]=~h[14]),r=0;r<16;r++)l[r]=n(e.b,4*r);for(r=0;r<10;r++)s(0,4,8,12,l[u[16*r+0]],l[u[16*r+1]]),s(1,5,9,13,l[u[16*r+2]],l[u[16*r+3]]),s(2,6,10,14,l[u[16*r+4]],l[u[16*r+5]]),s(3,7,11,15,l[u[16*r+6]],l[u[16*r+7]]),s(0,5,10,15,l[u[16*r+8]],l[u[16*r+9]]),s(1,6,11,12,l[u[16*r+10]],l[u[16*r+11]]),s(2,7,8,13,l[u[16*r+12]],l[u[16*r+13]]),s(3,4,9,14,l[u[16*r+14]],l[u[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=h[r]^h[r+8]}function c(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const i={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:e};return i.h[0]^=16842752^r<<8^e,r>0&&(f(i,t),i.c=64),i}function f(e,t){for(let r=0;r>2]>>8*(3&r)&255;return t}function m(e,t,r){r=r||32,e=i.normalizeInput(e);const n=c(r,t);return f(n,e),p(n)}e.exports={blake2s:m,blake2sHex:function(e,t,r){const n=m(e,t,r);return i.toHex(n)},blake2sInit:c,blake2sUpdate:f,blake2sFinal:p}},"../../node_modules/blakejs/index.js":(e,t,r)=>{const i=r("../../node_modules/blakejs/blake2b.js"),n=r("../../node_modules/blakejs/blake2s.js");e.exports={blake2b:i.blake2b,blake2bHex:i.blake2bHex,blake2bInit:i.blake2bInit,blake2bUpdate:i.blake2bUpdate,blake2bFinal:i.blake2bFinal,blake2s:n.blake2s,blake2sHex:n.blake2sHex,blake2sInit:n.blake2sInit,blake2sUpdate:n.blake2sUpdate,blake2sFinal:n.blake2sFinal}},"../../node_modules/blakejs/util.js":e=>{function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,r,i){let n="\n"+e+" = ";for(let s=0;s=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+e)}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,n){for(var s=0,o=0,a=Math.min(e.length,r),u=t;u=49?h-49+10:h>=17?h-17+10:h,i(h>=0&&o0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=a(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){s.prototype.inspect=l}else s.prototype.inspect=l;function l(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==s||o!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=c[e],l=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(e);r=(p=p.idivn(l)).isZero()?m+r:d[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16,2)},Buffer&&(s.prototype.toBuffer=function(e,t){return this.toArrayLike(Buffer,e,t)}),s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,u=o/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,t.length-1),f=Math.max(0,h-e.length+1);f<=c;f++){var p=h-f|0;l+=(o=(n=0|e.words[p])*(s=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r._strip()}s.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,s);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},s.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,s=0;n>8&255),r>16&255),6===s?(r>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===s?(r>=0&&(e[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,f=0|o[1],p=8191&f,m=f>>>13,b=0|o[2],g=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,T=0|o[5],I=8191&T,O=T>>>13,A=0|o[6],j=8191&A,k=A>>>13,x=0|o[7],R=8191&x,P=x>>>13,N=0|o[8],C=8191&N,B=N>>>13,U=0|o[9],D=8191&U,L=U>>>13,q=0|a[0],F=8191&q,z=q>>>13,H=0|a[1],V=8191&H,G=H>>>13,W=0|a[2],K=8191&W,$=W>>>13,Z=0|a[3],Y=8191&Z,X=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,le=0|a[8],de=8191&le,ce=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,z))+Math.imul(c,F)|0))<<13)|0;h=((s=Math.imul(c,z))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,s=Math.imul(m,z);var ge=(h+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((s=s+Math.imul(c,G)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,s=Math.imul(y,z),i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,G)|0;var ye=(h+(i=i+Math.imul(d,K)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,K)|0))<<13)|0;h=((s=s+Math.imul(c,$)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(_,F)|0,s=Math.imul(_,z),i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,$)|0;var ve=(h+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,Y)|0))<<13)|0;h=((s=s+Math.imul(c,X)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(S,F)|0,s=Math.imul(S,z),i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(g,K)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,$)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,X)|0;var we=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(c,Q)|0))<<13)|0;h=((s=s+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(O,F)|0,s=Math.imul(O,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,$)|0,i=i+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((s=s+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(k,F)|0,s=Math.imul(k,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(O,V)|0,s=s+Math.imul(O,G)|0,i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,s=s+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(d,se)|0)|0)+((8191&(n=(n=n+Math.imul(d,oe)|0)+Math.imul(c,se)|0))<<13)|0;h=((s=s+Math.imul(c,oe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,z))+Math.imul(P,F)|0,s=Math.imul(P,z),i=i+Math.imul(j,V)|0,n=(n=n+Math.imul(j,G)|0)+Math.imul(k,V)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(O,K)|0,s=s+Math.imul(O,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0;var Ee=(h+(i=i+Math.imul(d,ue)|0)|0)+((8191&(n=(n=n+Math.imul(d,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((s=s+Math.imul(c,he)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,z))+Math.imul(B,F)|0,s=Math.imul(B,z),i=i+Math.imul(R,V)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,$)|0)+Math.imul(k,K)|0,s=s+Math.imul(k,$)|0,i=i+Math.imul(I,Y)|0,n=(n=n+Math.imul(I,X)|0)+Math.imul(O,Y)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(g,se)|0,n=(n=n+Math.imul(g,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,s=s+Math.imul(m,he)|0;var Se=(h+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ce)|0)+Math.imul(c,de)|0))<<13)|0;h=((s=s+Math.imul(c,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,z))+Math.imul(L,F)|0,s=Math.imul(L,z),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,G)|0,i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,K)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,X)|0)+Math.imul(k,Y)|0,s=s+Math.imul(k,X)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(w,se)|0,n=(n=n+Math.imul(w,oe)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(g,ue)|0,n=(n=n+Math.imul(g,he)|0)+Math.imul(y,ue)|0,s=s+Math.imul(y,he)|0,i=i+Math.imul(p,de)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,de)|0,s=s+Math.imul(m,ce)|0;var Te=(h+(i=i+Math.imul(d,pe)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((s=s+Math.imul(c,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,G))+Math.imul(L,V)|0,s=Math.imul(L,G),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,X)|0,i=i+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(O,re)|0,s=s+Math.imul(O,ie)|0,i=i+Math.imul(E,se)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,s=s+Math.imul(_,he)|0,i=i+Math.imul(g,de)|0,n=(n=n+Math.imul(g,ce)|0)+Math.imul(y,de)|0,s=s+Math.imul(y,ce)|0;var Ie=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((s=s+Math.imul(m,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,$))+Math.imul(L,K)|0,s=Math.imul(L,$),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(j,re)|0,n=(n=n+Math.imul(j,ie)|0)+Math.imul(k,re)|0,s=s+Math.imul(k,ie)|0,i=i+Math.imul(I,se)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(O,se)|0,s=s+Math.imul(O,oe)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(S,ue)|0,s=s+Math.imul(S,he)|0,i=i+Math.imul(w,de)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,de)|0,s=s+Math.imul(_,ce)|0;var Oe=(h+(i=i+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,me)|0)+Math.imul(y,pe)|0))<<13)|0;h=((s=s+Math.imul(y,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(L,Y)|0,s=Math.imul(L,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(j,se)|0,n=(n=n+Math.imul(j,oe)|0)+Math.imul(k,se)|0,s=s+Math.imul(k,oe)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(O,ue)|0,s=s+Math.imul(O,he)|0,i=i+Math.imul(E,de)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(S,de)|0,s=s+Math.imul(S,ce)|0;var Ae=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((s=s+Math.imul(_,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(L,Q)|0,s=Math.imul(L,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(B,re)|0,s=s+Math.imul(B,ie)|0,i=i+Math.imul(R,se)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(j,ue)|0,n=(n=n+Math.imul(j,he)|0)+Math.imul(k,ue)|0,s=s+Math.imul(k,he)|0,i=i+Math.imul(I,de)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(O,de)|0,s=s+Math.imul(O,ce)|0;var je=(h+(i=i+Math.imul(E,pe)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;h=((s=s+Math.imul(S,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(L,re)|0,s=Math.imul(L,ie),i=i+Math.imul(C,se)|0,n=(n=n+Math.imul(C,oe)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,oe)|0,i=i+Math.imul(R,ue)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(P,ue)|0,s=s+Math.imul(P,he)|0,i=i+Math.imul(j,de)|0,n=(n=n+Math.imul(j,ce)|0)+Math.imul(k,de)|0,s=s+Math.imul(k,ce)|0;var ke=(h+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((s=s+Math.imul(O,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,se),n=(n=Math.imul(D,oe))+Math.imul(L,se)|0,s=Math.imul(L,oe),i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(B,ue)|0,s=s+Math.imul(B,he)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,ce)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,ce)|0;var xe=(h+(i=i+Math.imul(j,pe)|0)|0)+((8191&(n=(n=n+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((s=s+Math.imul(k,me)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(D,ue),n=(n=Math.imul(D,he))+Math.imul(L,ue)|0,s=Math.imul(L,he),i=i+Math.imul(C,de)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,ce)|0;var Re=(h+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((s=s+Math.imul(P,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,de),n=(n=Math.imul(D,ce))+Math.imul(L,de)|0,s=Math.imul(L,ce);var Pe=(h+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((s=s+Math.imul(B,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(h+(i=Math.imul(D,pe))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(L,pe)|0))<<13)|0;return h=((s=Math.imul(L,me))+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=be,u[1]=ge,u[2]=ye,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Ee,u[8]=Se,u[9]=Te,u[10]=Ie,u[11]=Oe,u[12]=Ae,u[13]=je,u[14]=ke,u[15]=xe,u[16]=Re,u[17]=Pe,u[18]=Ne,0!==h&&(u[19]=h,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function g(e,t,r){return b(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(m=p),s.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?b(this,e,t):g(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i>=1;return i},y.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,r+=s/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n&1}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-s|d>>>s,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==t){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/o|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modrn=function(e){var t=e<0;t&&(e=-e),i(e<=67108863);for(var r=(1<<26)%e,n=0,s=this.length-1;s>=0;s--)n=(r*n+(0|this.words[s]))%e;return t?-n:n},s.prototype.modn=function(e){return this.modrn(e)},s.prototype.idivn=function(e){var t=e<0;t&&(e=-e),i(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+67108864*r;this.words[n]=s/e|0,r=s%e}return this._strip(),t?this.ineg():this},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new T(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(_,w),_.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new M;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},T.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(e,n.addn(1).iushrn(1)),f=this.pow(e,n),p=o;0!==f.cmp(a);){for(var m=f,b=0;0!==m.cmp(a);b++)m=m.redSqr();i(b=0;i--){for(var h=t.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}u=26}return n},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new I(e)},n(I,T),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},I.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},I.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/brorand/index.js":(e,t,r)=>{var i;function n(e){this.rand=e}if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function i(e){Buffer.isBuffer(e)||(e=Buffer.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i>>24]^l[p>>>16&255]^d[m>>>8&255]^c[255&b]^t[g++],o=h[p>>>24]^l[m>>>16&255]^d[b>>>8&255]^c[255&f]^t[g++],a=h[m>>>24]^l[b>>>16&255]^d[f>>>8&255]^c[255&p]^t[g++],u=h[b>>>24]^l[f>>>16&255]^d[p>>>8&255]^c[255&m]^t[g++],f=s,p=o,m=a,b=u;return s=(i[f>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&b])^t[g++],o=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[b>>>8&255]<<8|i[255&f])^t[g++],a=(i[m>>>24]<<24|i[b>>>16&255]<<16|i[f>>>8&255]<<8|i[255&p])^t[g++],u=(i[b>>>24]<<24|i[f>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^t[g++],[s>>>=0,o>>>=0,a>>>=0,u>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],a=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],s=[[],[],[],[]],o=0,a=0,u=0;u<256;++u){var h=a^a<<1^a<<2^a<<3^a<<4;h=h>>>8^255&h^99,r[o]=h,i[h]=o;var l=e[o],d=e[l],c=e[d],f=257*e[h]^16843008*h;n[0][o]=f<<24|f>>>8,n[1][o]=f<<16|f>>>16,n[2][o]=f<<8|f>>>24,n[3][o]=f,f=16843009*c^65537*d^257*l^16843008*o,s[0][h]=f<<24|f>>>8,s[1][h]=f<<16|f>>>16,s[2][h]=f<<8|f>>>24,s[3][h]=f,0===o?o=a=1:(o=l^e[e[e[c^l]]],a^=e[e[a]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:s}}();function u(e){this._key=i(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],s=0;s>>24,u=a.SBOX[u>>>24]<<24|a.SBOX[u>>>16&255]<<16|a.SBOX[u>>>8&255]<<8|a.SBOX[255&u],u^=o[s/t|0]<<24):t>6&&s%t==4&&(u=a.SBOX[u>>>24]<<24|a.SBOX[u>>>16&255]<<16|a.SBOX[u>>>8&255]<<8|a.SBOX[255&u]),n[s]=n[s-t]^u}for(var h=[],l=0;l>>24]]^a.INV_SUB_MIX[1][a.SBOX[c>>>16&255]]^a.INV_SUB_MIX[2][a.SBOX[c>>>8&255]]^a.INV_SUB_MIX[3][a.SBOX[255&c]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=h},u.prototype.encryptBlockRaw=function(e){return s(e=i(e),this._keySchedule,a.SUB_MIX,a.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=Buffer.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},u.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=s(e,this._invKeySchedule,a.INV_SUB_MIX,a.INV_SBOX,this._nRounds),n=Buffer.allocUnsafe(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[3],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[1],12),n},u.prototype.scrub=function(){n(this._keySchedule),n(this._invKeySchedule),n(this._key)},e.exports.AES=u},"../../node_modules/browserify-aes/authCipher.js":(e,t,r)=>{var i=r("../../node_modules/browserify-aes/aes.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/cipher-base/index.js"),s=r("../../node_modules/inherits/inherits_browser.js"),o=r("../../node_modules/browserify-aes/ghash.js"),a=r("../../node_modules/buffer-xor/index.js"),u=r("../../node_modules/browserify-aes/incr32.js");function h(e,t,r,s){n.call(this);var a=Buffer.alloc(4,0);this._cipher=new i.AES(t);var h=this._cipher.encryptBlock(a);this._ghash=new o(h),r=function(e,t,r){if(12===t.length)return e._finID=Buffer.concat([t,Buffer.from([0,0,0,1])]),Buffer.concat([t,Buffer.from([0,0,0,2])]);var i=new o(r),n=t.length,s=n%16;i.update(t),s&&(s=16-s,i.update(Buffer.alloc(s,0))),i.update(Buffer.alloc(8,0));var a=8*n,h=Buffer.alloc(8);h.writeUIntBE(a,0,8),i.update(h),e._finID=i.state;var l=Buffer.from(e._finID);return u(l),l}(this,r,h),this._prev=Buffer.from(r),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}s(h,n),h.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=Buffer.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},h.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=a(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n{var i=r("../../node_modules/browserify-aes/encrypter.js"),n=r("../../node_modules/browserify-aes/decrypter.js"),s=r("../../node_modules/browserify-aes/modes/list.json");t.createCipher=t.Cipher=i.createCipher,t.createCipheriv=t.Cipheriv=i.createCipheriv,t.createDecipher=t.Decipher=n.createDecipher,t.createDecipheriv=t.Decipheriv=n.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(s)}},"../../node_modules/browserify-aes/decrypter.js":(e,t,r)=>{var i=r("../../node_modules/browserify-aes/authCipher.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/browserify-aes/modes/index.js"),s=r("../../node_modules/browserify-aes/streamCipher.js"),o=r("../../node_modules/cipher-base/index.js"),a=r("../../node_modules/browserify-aes/aes.js"),u=r("../../node_modules/evp_bytestokey/index.js");function h(e,t,r){o.call(this),this._cache=new l,this._last=void 0,this._cipher=new a.AES(t),this._prev=Buffer.from(r),this._mode=e,this._autopadding=!0}function l(){this.cache=Buffer.allocUnsafe(0)}function d(e,t,r){var o=n[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=Buffer.from(r)),"GCM"!==o.mode&&r.length!==o.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=Buffer.from(t)),t.length!==o.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===o.type?new s(o.module,t,r,!0):"auth"===o.type?new i(o.module,t,r,!0):new h(o.module,t,r)}r("../../node_modules/inherits/inherits_browser.js")(h,o),h.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),i.push(r);return Buffer.concat(i)},h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(t,!1,r.key,r.iv);return d(e,i.key,i.iv)},t.createDecipheriv=d},"../../node_modules/browserify-aes/encrypter.js":(e,t,r)=>{var i=r("../../node_modules/browserify-aes/modes/index.js"),n=r("../../node_modules/browserify-aes/authCipher.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=r("../../node_modules/browserify-aes/streamCipher.js"),o=r("../../node_modules/cipher-base/index.js"),a=r("../../node_modules/browserify-aes/aes.js"),u=r("../../node_modules/evp_bytestokey/index.js");function h(e,t,r){o.call(this),this._cache=new d,this._cipher=new a.AES(t),this._prev=Buffer.from(r),this._mode=e,this._autopadding=!0}r("../../node_modules/inherits/inherits_browser.js")(h,o),h.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get();)r=this._mode.encrypt(this,t),i.push(r);return Buffer.concat(i)};var l=Buffer.alloc(16,16);function d(){this.cache=Buffer.allocUnsafe(0)}function c(e,t,r){var o=i[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=Buffer.from(t)),t.length!==o.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=Buffer.from(r)),"GCM"!==o.mode&&r.length!==o.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===o.type?new s(o.module,t,r):"auth"===o.type?new n(o.module,t,r):new h(o.module,t,r)}h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=Buffer.concat([this.cache,e])},d.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=Buffer.allocUnsafe(e),r=-1;++r{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=Buffer.alloc(16,0);function n(e){var t=Buffer.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function s(e){this.h=e,this.state=Buffer.alloc(16,0),this.cache=Buffer.allocUnsafe(0)}s.prototype.ghash=function(e){for(var t=-1;++t0;t--)i[t]=i[t]>>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,r&&(i[0]=i[0]^225<<24)}this.state=n(s)},s.prototype.update=function(e){var t;for(this.cache=Buffer.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},s.prototype.final=function(e,t){return this.cache.length&&this.ghash(Buffer.concat([this.cache,i],16)),this.ghash(n([0,e,0,t])),this.state},e.exports=s},"../../node_modules/browserify-aes/incr32.js":e=>{e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},"../../node_modules/browserify-aes/modes/cbc.js":(e,t,r)=>{var i=r("../../node_modules/buffer-xor/index.js");t.encrypt=function(e,t){var r=i(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return i(n,r)}},"../../node_modules/browserify-aes/modes/cfb.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/buffer-xor/index.js");function n(e,t,r){var n=t.length,s=i(t,e._cache);return e._cache=e._cache.slice(n),e._prev=Buffer.concat([e._prev,r?t:s]),s}t.encrypt=function(e,t,r){for(var i,s=Buffer.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=Buffer.allocUnsafe(0)),!(e._cache.length<=t.length)){s=Buffer.concat([s,n(e,t,r)]);break}i=e._cache.length,s=Buffer.concat([s,n(e,t.slice(0,i),r)]),t=t.slice(i)}return s}},"../../node_modules/browserify-aes/modes/cfb1.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function i(e,t,r){for(var i,s,o=-1,a=0;++o<8;)i=t&1<<7-o?128:0,a+=(128&(s=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=n(e._prev,r?i:s);return a}function n(e,t){var r=e.length,i=-1,n=Buffer.allocUnsafe(e.length);for(e=Buffer.concat([e,Buffer.from([t])]);++i>7;return n}t.encrypt=function(e,t,r){for(var n=t.length,s=Buffer.allocUnsafe(n),o=-1;++o{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=Buffer.concat([e._prev.slice(1),Buffer.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var n=t.length,s=Buffer.allocUnsafe(n),o=-1;++o{var i=r("../../node_modules/buffer-xor/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/browserify-aes/incr32.js");function s(e){var t=e._cipher.encryptBlockRaw(e._prev);return n(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),n=e._cache.length;e._cache=Buffer.concat([e._cache,Buffer.allocUnsafe(16*r)]);for(var o=0;o{t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},"../../node_modules/browserify-aes/modes/index.js":(e,t,r)=>{var i={ECB:r("../../node_modules/browserify-aes/modes/ecb.js"),CBC:r("../../node_modules/browserify-aes/modes/cbc.js"),CFB:r("../../node_modules/browserify-aes/modes/cfb.js"),CFB8:r("../../node_modules/browserify-aes/modes/cfb8.js"),CFB1:r("../../node_modules/browserify-aes/modes/cfb1.js"),OFB:r("../../node_modules/browserify-aes/modes/ofb.js"),CTR:r("../../node_modules/browserify-aes/modes/ctr.js"),GCM:r("../../node_modules/browserify-aes/modes/ctr.js")},n=r("../../node_modules/browserify-aes/modes/list.json");for(var s in n)n[s].module=i[n[s].mode];e.exports=n},"../../node_modules/browserify-aes/modes/ofb.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer,i=r("../../node_modules/buffer-xor/index.js");function n(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(e,t){for(;e._cache.length{var i=r("../../node_modules/browserify-aes/aes.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/cipher-base/index.js");function s(e,t,r,s){n.call(this),this._cipher=new i.AES(t),this._prev=Buffer.from(r),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=s,this._mode=e}r("../../node_modules/inherits/inherits_browser.js")(s,n),s.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},e.exports=s},"../../node_modules/browserify-cipher/browser.js":(e,t,r)=>{var i=r("../../node_modules/browserify-des/index.js"),n=r("../../node_modules/browserify-aes/browser.js"),s=r("../../node_modules/browserify-aes/modes/index.js"),o=r("../../node_modules/browserify-des/modes.js"),a=r("../../node_modules/evp_bytestokey/index.js");function u(e,t,r){if(e=e.toLowerCase(),s[e])return n.createCipheriv(e,t,r);if(o[e])return new i({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function h(e,t,r){if(e=e.toLowerCase(),s[e])return n.createDecipheriv(e,t,r);if(o[e])return new i({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,i;if(e=e.toLowerCase(),s[e])r=s[e].key,i=s[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");r=8*o[e].key,i=o[e].iv}var n=a(t,!1,r,i);return u(e,n.key,n.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var r,i;if(e=e.toLowerCase(),s[e])r=s[e].key,i=s[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");r=8*o[e].key,i=o[e].iv}var n=a(t,!1,r,i);return h(e,n.key,n.iv)},t.createDecipheriv=t.Decipheriv=h,t.listCiphers=t.getCiphers=function(){return Object.keys(o).concat(n.getCiphers())}},"../../node_modules/browserify-des/index.js":(e,t,r)=>{var i=r("../../node_modules/cipher-base/index.js"),n=r("../../node_modules/des.js/lib/des.js"),s=r("../../node_modules/inherits/inherits_browser.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o={"des-ede3-cbc":n.CBC.instantiate(n.EDE),"des-ede3":n.EDE,"des-ede-cbc":n.CBC.instantiate(n.EDE),"des-ede":n.EDE,"des-cbc":n.CBC.instantiate(n.DES),"des-ecb":n.DES};function a(e){i.call(this);var t,r=e.mode.toLowerCase(),n=o[r];t=e.decrypt?"decrypt":"encrypt";var s=e.key;Buffer.isBuffer(s)||(s=Buffer.from(s)),"des-ede"!==r&&"des-ede-cbc"!==r||(s=Buffer.concat([s,s.slice(0,8)]));var a=e.iv;Buffer.isBuffer(a)||(a=Buffer.from(a)),this._des=n.create({key:s,iv:a,type:t})}o.des=o["des-cbc"],o.des3=o["des-ede3-cbc"],e.exports=a,s(a,i),a.prototype._update=function(e){return Buffer.from(this._des.update(e))},a.prototype._final=function(){return Buffer.from(this._des.final())}},"../../node_modules/browserify-des/modes.js":(e,t)=>{t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},"../../node_modules/browserify-rsa/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer,i=r("../../node_modules/bn.js/lib/bn.js"),n=r("../../node_modules/randombytes/browser.js");function s(e){var t,r=e.modulus.byteLength();do{t=new i(n(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function o(e,t){var r=function(e){var t=s(e);return{blinder:t.toRed(i.mont(e.modulus)).redPow(new i(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),n=t.modulus.byteLength(),o=new i(e).mul(r.blinder).umod(t.modulus),a=o.toRed(i.mont(t.prime1)),u=o.toRed(i.mont(t.prime2)),h=t.coefficient,l=t.prime1,d=t.prime2,c=a.redPow(t.exponent1).fromRed(),f=u.redPow(t.exponent2).fromRed(),p=c.isub(f).imul(h).umod(l).imul(d);return f.iadd(p).imul(r.unblinder).umod(t.modulus).toArrayLike(Buffer,"be",n)}o.getr=s,e.exports=o},"../../node_modules/browserify-sign/algos.js":(e,t,r)=>{e.exports=r("../../node_modules/browserify-sign/browser/algorithms.json")},"../../node_modules/browserify-sign/browser/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/create-hash/browser.js"),n=r("../../node_modules/readable-stream/readable-browser.js"),s=r("../../node_modules/inherits/inherits_browser.js"),o=r("../../node_modules/browserify-sign/browser/sign.js"),a=r("../../node_modules/browserify-sign/browser/verify.js"),u=r("../../node_modules/browserify-sign/browser/algorithms.json");function h(e){n.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function l(e){n.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){return new h(e)}function c(e){return new l(e)}Object.keys(u).forEach((function(e){u[e].id=Buffer.from(u[e].id,"hex"),u[e.toLowerCase()]=u[e]})),s(h,n.Writable),h.prototype._write=function(e,t,r){this._hash.update(e),r()},h.prototype.update=function(e,t){return"string"==typeof e&&(e=Buffer.from(e,t)),this._hash.update(e),this},h.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),i=o(r,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i},s(l,n.Writable),l.prototype._write=function(e,t,r){this._hash.update(e),r()},l.prototype.update=function(e,t){return"string"==typeof e&&(e=Buffer.from(e,t)),this._hash.update(e),this},l.prototype.verify=function(e,t,r){"string"==typeof t&&(t=Buffer.from(t,r)),this.end();var i=this._hash.digest();return a(t,i,e,this._signType,this._tag)},e.exports={Sign:d,Verify:c,createSign:d,createVerify:c}},"../../node_modules/browserify-sign/browser/sign.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/create-hmac/browser.js"),n=r("../../node_modules/browserify-rsa/index.js"),s=r("../../node_modules/elliptic/lib/elliptic.js").ec,o=r("../../node_modules/bn.js/lib/bn.js"),a=r("../../node_modules/parse-asn1/index.js"),u=r("../../node_modules/browserify-sign/browser/curves.json");function h(e,t,r,n){if((e=Buffer.from(e.toArray())).length0&&r.ishrn(i),r}function d(e,t,r){var n,s;do{for(n=Buffer.alloc(0);8*n.length{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/bn.js/lib/bn.js"),n=r("../../node_modules/elliptic/lib/elliptic.js").ec,s=r("../../node_modules/parse-asn1/index.js"),o=r("../../node_modules/browserify-sign/browser/curves.json");function a(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,t,r,u,h){var l=s(r);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var i=o[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var s=new n(i),a=r.data.subjectPrivateKey.data;return s.verify(t,e,a)}(e,t,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var n=r.data.p,o=r.data.q,u=r.data.g,h=r.data.pub_key,l=s.signature.decode(e,"der"),d=l.s,c=l.r;a(d,o),a(c,o);var f=i.mont(n),p=d.invm(o),m=u.toRed(f).redPow(new i(t).mul(p).mod(o)).fromRed().mul(h.toRed(f).redPow(c.mul(p).mod(o)).fromRed()).mod(n).mod(o);return 0===m.cmp(c)}(e,t,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");t=Buffer.concat([h,t]);for(var d=l.modulus.byteLength(),c=[1],f=0;t.length+c.length+2{const i=r("../../node_modules/bs58/node_modules/base-x/src/index.js");e.exports=i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},"../../node_modules/bs58/node_modules/base-x/src/index.js":e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,h=new Uint8Array(s);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var d=0,c=s-1;(0!==l||d>>0,h[c]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");n=d,r++}for(var f=s-n;f!==s&&0===h[f];)f++;for(var p=new Uint8Array(i+(s-f)),m=i;f!==s;)p[m++]=h[f++];return p}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,i=0,n=0,s=t.length;n!==s&&0===t[n];)n++,r++;for(var u=(s-n)*h+1>>>0,l=new Uint8Array(u);n!==s;){for(var d=t[n],c=0,f=u-1;(0!==d||c>>0,l[f]=d%o>>>0,d=d/o>>>0;if(0!==d)throw new Error("Non-zero carry");i=c,n++}for(var p=u-i;p!==u&&0===l[p];)p++;for(var m=a.repeat(r);p{"use strict";var i=r("../../node_modules/bs58/index.js");e.exports=function(e){function t(t){var r=t.slice(0,-4),i=t.slice(-4),n=e(r);if(!(i[0]^n[0]|i[1]^n[1]|i[2]^n[2]|i[3]^n[3]))return r}return{encode:function(t){var r=Uint8Array.from(t),n=e(r),s=r.length+4,o=new Uint8Array(s);return o.set(r,0),o.set(n.subarray(0,4),r.length),i.encode(o,s)},decode:function(e){var r=t(i.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=i.decodeUnsafe(e);if(r)return t(r)}}}},"../../node_modules/bs58check/index.js":(e,t,r)=>{"use strict";var{sha256:i}=r("../../node_modules/@noble/hashes/sha256.js"),n=r("../../node_modules/bs58check/base.js");e.exports=n((function(e){return i(i(e))}))},"../../node_modules/buffer-xor/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer;e.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new Buffer(r),n=0;n{"use strict"; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */const i=r("../../node_modules/base64-js/index.js"),n=r("../../node_modules/ieee754/index.js"),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=Buffer,t.SlowBuffer=function(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|p(e,t);let i=a(r);const n=i.write(e,t);n!==r&&(i=i.slice(0,n));return i}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){const t=new Uint8Array(e);return c(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return c(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return c(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return Buffer.from(i,t,r);const n=function(e){if(Buffer.isBuffer(e)){const t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Z(e.length)?a(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return h(e),a(e<0?0:0|f(e))}function d(e){const t=e.length<0?0:0|f(e.length),r=a(t);for(let i=0;i=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function p(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(n)return i?-1:G(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function b(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function g(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,i)),Buffer.isBuffer(t))return 0===t.length?-1:y(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,i,n){let s,o=1,a=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,r/=2}function h(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){let i=-1;for(s=r;sa&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let i=0;in&&(i=n):i=n;const s=t.length;let o;for(i>s/2&&(i=s/2),o=0;o>8,n=r%256,s.push(n),s.push(i);return s}(t,e.length-r),e,r,i)}function S(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);const i=[];let n=t;for(;n239?4:t>223?3:t>191?2:1;if(n+o<=r){let r,i,a,u;switch(o){case 1:t<128&&(s=t);break;case 2:r=e[n+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(s=u));break;case 3:r=e[n+1],i=e[n+2],128==(192&r)&&128==(192&i)&&(u=(15&t)<<12|(63&r)<<6|63&i,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:r=e[n+1],i=e[n+2],a=e[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&a,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),n+=o}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",i=0;for(;ii.length?(Buffer.isBuffer(t)||(t=Buffer.from(t)),t.copy(i,n)):Uint8Array.prototype.set.call(i,t,n);else{if(!Buffer.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,n)}n+=t.length}return i},Buffer.byteLength=p,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},s&&(Buffer.prototype[s]=Buffer.prototype.inspect),Buffer.prototype.compare=function(e,t,r,i,n){if($(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0);const a=Math.min(s,o),u=this.slice(i,n),h=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return M(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function O(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;ni)&&(r=i);let n="";for(let i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,i,n,s){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function P(e,t,r,i,n){F(t,i,n,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function N(e,t,r,i,n){F(t,i,n,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function C(e,t,r,i,n,s){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,i,s){return t=+t,r>>>=0,s||C(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function U(e,t,r,i,s){return t=+t,r>>>=0,s||C(e,0,r,8),n.write(e,t,r,i,52,8),r+8}Buffer.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||x(e,t,this.length);let i=this[e],n=1,s=0;for(;++s>>=0,t>>>=0,r||x(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readBigUInt64LE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(i)+(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<>>=0,t>>>=0,r||x(e,t,this.length);let i=this[e],n=1,s=0;for(;++s=n&&(i-=Math.pow(2,8*t)),i},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);let i=t,n=1,s=this[e+--i];for(;i>0&&(n*=256);)s+=this[e+--i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*t)),s},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readBigInt64LE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<>>=0,t||x(e,4,this.length),n.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),n.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),n.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),n.read(this,e,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,!i){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=r-1,s=1;for(this[t+n]=255&e;--n>=0&&(s*=256);)this[t+n]=e/s&255;return t+r},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigUInt64LE=X((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeBigUInt64BE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}let n=0,s=1,o=0;for(this[t]=255&e;++n>0)-o&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[t+n]=255&e;--n>=0&&(s*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/s>>0)-o&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigInt64LE=X((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeBigInt64BE=X((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,i){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,i,n,s){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(s+1)}${i}`:`>= -(2${i} ** ${8*(s+1)-1}${i}) and < 2 ** ${8*(s+1)-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new D.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(i,n,s)}function z(e,t){if("number"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new D.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}L("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),L("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),L("ERR_OUT_OF_RANGE",(function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=q(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=q(n)),n+="n"),i+=` It must be ${t}. Received ${n}`,i}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const i=e.length;let n=null;const s=[];for(let o=0;o55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function W(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,i){let n;for(n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function X(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}},"../../node_modules/bytebuffer/dist/bytebuffer.js":function(e,t,r){var i,n,s; +/** + * @license bytebuffer.js (c) 2015 Daniel Wirtz + * Backing buffer: ArrayBuffer, Accessor: Uint8Array + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/bytebuffer.js for details + */n=[r("../../node_modules/bytebuffer/node_modules/long/dist/long.js")],i=function(e){"use strict";var t=function(e,r,n){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===r&&(r=t.DEFAULT_ENDIAN),void 0===n&&(n=t.DEFAULT_NOASSERT),!n){if((e|=0)<0)throw RangeError("Illegal capacity");r=!!r,n=!!n}this.buffer=0===e?i:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=r,this.noAssert=n};t.VERSION="5.0.1",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var r=t.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var i=new ArrayBuffer(0),n=String.fromCharCode;function s(e){var t=0;return function(){return t1024&&(t.push(n.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function a(e,t,r,i,n){var s,o,a=8*n-i-1,u=(1<>1,l=-7,d=r?n-1:0,c=r?-1:1,f=e[t+d];for(d+=c,s=f&(1<<-l)-1,f>>=-l,l+=a;l>0;s=256*s+e[t+d],d+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=i;l>0;o=256*o+e[t+d],d+=c,l-=8);if(0===s)s=1-h;else{if(s===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,i),s-=h}return(f?-1:1)*o*Math.pow(2,s-i)}function u(e,t,r,i,n,s){var o,a,u,h=8*s-n-1,l=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:s-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?c/u:c*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=l?(a=0,o=l):o+d>=1?(a=(t*u-1)*Math.pow(2,n),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,n),o=0));n>=8;e[r+f]=255&a,f+=p,a/=256,n-=8);for(o=o<0;e[r+f]=255&o,f+=p,o/=256,h-=8);e[r+f-p]|=128*m}t.accessor=function(){return Uint8Array},t.allocate=function(e,r,i){return new t(e,r,i)},t.concat=function(e,r,i,n){"boolean"!=typeof r&&"string"==typeof r||(n=i,i=r,r=void 0);for(var s,o=0,a=0,u=e.length;a0&&(o+=s);if(0===o)return new t(0,i,n);var h,l=new t(o,i,n);for(a=0;a0&&(o.buffer=e.buffer,o.offset=e.byteOffset,o.limit=e.byteOffset+e.byteLength,o.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)o=new t(0,n,s),e.byteLength>0&&(o.buffer=e,o.offset=0,o.limit=e.byteLength,o.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(o=new t(e.length,n,s)).limit=e.length;for(var a=0;a>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i,n=t,s=e.length,o=s>>3,a=0;for(t+=this.writeVarint32(s,t);o--;)i=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(i,t++);if(a>3,o=0,a=[];for(e+=i.length;s--;)r=this.readByte(e++),a[o++]=!!(1&r),a[o++]=!!(2&r),a[o++]=!!(4&r),a[o++]=!!(8&r),a[o++]=!!(16&r),a[o++]=!!(32&r),a[o++]=!!(64&r),a[o++]=!!(128&r);if(o>u++&1)}return t&&(this.offset=e),a},r.readBytes=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var i=this.slice(t,t+e);return r&&(this.offset+=e),i},r.writeBytes=r.append,r.writeInt8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return 128==(128&r)&&(r=-(255-r+1)),t&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return t&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),32768==(32768&r)&&(r=-(65535-r+1)),t&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeUInt16=r.writeUint16,r.readUint16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),t&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),r|=0,t&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),t&&(this.offset+=4),r},r.readUInt32=r.readUint32,e&&(r.writeInt64=function(t,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var n=this.buffer.byteLength;r>n&&this.resize((n*=2)>r?n:r),r-=8;var s=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s),i&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var i=0,n=0;this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0);var s=new e(i,n,!1);return r&&(this.offset+=8),s},r.readLong=r.readInt64,r.writeUint64=function(t,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var n=this.buffer.byteLength;r>n&&this.resize((n*=2)>r?n:r),r-=8;var s=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s),i&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var i=0,n=0;this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0);var s=new e(i,n,!0);return r&&(this.offset+=8),s},r.readUInt64=r.readUint64),r.writeFloat32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,u(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=a(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=8,u(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=a(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),r},r.readDouble=r.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},r.writeVarint32=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var n,s=t.calculateVarint32(e);r+=s;var o=this.buffer.byteLength;for(r>o&&this.resize((o*=2)>r?o:r),r-=s,e>>>=0;e>=128;)n=127&e|128,this.view[r++]=n,e>>>=7;return this.view[r++]=e,i?(this.offset=r,this):s},r.writeVarint32ZigZag=function(e,r){return this.writeVarint32(t.zigZagEncode32(e),r)},r.readVarint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=0,n=0;do{if(!this.noAssert&&e>this.limit){var s=Error("Truncated");throw s.truncated=!0,s}r=this.view[e++],i<5&&(n|=(127&r)<<7*i),++i}while(0!=(128&r));return n|=0,t?(this.offset=e,n):{value:n,length:i}},r.readVarint32ZigZag=function(e){var r=this.readVarint32(e);return"object"==typeof r?r.value=t.zigZagDecode32(r.value):r=t.zigZagDecode32(r),r},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,i=t.shiftRightUnsigned(28).toInt()>>>0,n=t.shiftRightUnsigned(56).toInt()>>>0;return 0==n?0==i?r<16384?r<128?1:2:r<1<<21?3:4:i<16384?i<128?5:6:i<1<<21?7:8:n<128?9:10},t.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},t.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},r.writeVarint64=function(r,i){var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"==typeof r)r=e.fromNumber(r);else if("string"==typeof r)r=e.fromString(r);else if(!(r&&r instanceof e))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=e.fromNumber(r,!1):"string"==typeof r?r=e.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var s=t.calculateVarint64(r),o=r.toInt()>>>0,a=r.shiftRightUnsigned(28).toInt()>>>0,u=r.shiftRightUnsigned(56).toInt()>>>0;i+=s;var h=this.buffer.byteLength;switch(i>h&&this.resize((h*=2)>i?h:i),i-=s,s){case 10:this.view[i+9]=u>>>7&1;case 9:this.view[i+8]=9!==s?128|u:127&u;case 8:this.view[i+7]=8!==s?a>>>21|128:a>>>21&127;case 7:this.view[i+6]=7!==s?a>>>14|128:a>>>14&127;case 6:this.view[i+5]=6!==s?a>>>7|128:a>>>7&127;case 5:this.view[i+4]=5!==s?128|a:127&a;case 4:this.view[i+3]=4!==s?o>>>21|128:o>>>21&127;case 3:this.view[i+2]=3!==s?o>>>14|128:o>>>14&127;case 2:this.view[i+1]=2!==s?o>>>7|128:o>>>7&127;case 1:this.view[i]=1!==s?128|o:127&o}return n?(this.offset+=s,this):s},r.writeVarint64ZigZag=function(e,r){return this.writeVarint64(t.zigZagEncode64(e),r)},r.readVarint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i=t,n=0,s=0,o=0,a=0;if(n=127&(a=this.view[t++]),128&a&&(n|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(s=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(o=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<7,128&a||this.noAssert&&void 0===a))))))))))throw Error("Buffer overrun");var u=e.fromBits(n|s<<28,s>>>4|o<<24,!1);return r?(this.offset=t,u):{value:u,length:t-i}},r.readVarint64ZigZag=function(r){var i=this.readVarint64(r);return i&&i.value instanceof e?i.value=t.zigZagDecode64(i.value):i=t.zigZagDecode64(i),i}),r.writeCString=function(e,t){var r=void 0===t;r&&(t=this.offset);var i,n=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}n=l.calculateUTF16asUTF8(s(e))[1],t+=n+1;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=n+1,l.encodeUTF16toUTF8(s(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,r?(this.offset=t,this):n},r.readCString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=e,n=-1;return l.decodeUTF8toUTF16(function(){if(0===n)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(n=this.view[e++])?null:n}.bind(this),r=o(),!0),t?(this.offset=e,r()):{string:r(),length:e-i}},r.writeIString=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i,n=t;i=l.calculateUTF16asUTF8(s(e),this.noAssert)[1],t+=4+i;var o=this.buffer.byteLength;if(t>o&&this.resize((o*=2)>t?o:t),t-=4+i,this.littleEndian?(this.view[t+3]=i>>>24&255,this.view[t+2]=i>>>16&255,this.view[t+1]=i>>>8&255,this.view[t]=255&i):(this.view[t]=i>>>24&255,this.view[t+1]=i>>>16&255,this.view[t+2]=i>>>8&255,this.view[t+3]=255&i),t+=4,l.encodeUTF16toUTF8(s(e),function(e){this.view[t++]=e}.bind(this)),t!==n+4+i)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+i));return r?(this.offset=t,this):t-n},r.readIString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var i=e,n=this.readUint32(e),s=this.readUTF8String(n,t.METRICS_BYTES,e+=4);return e+=s.length,r?(this.offset=e,s.string):{string:s.string,length:e-i}},t.METRICS_CHARS="c",t.METRICS_BYTES="b",r.writeUTF8String=function(e,t){var r,i=void 0===t;if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var n=t;r=l.calculateUTF16asUTF8(s(e))[1],t+=r;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=r,l.encodeUTF16toUTF8(s(e),function(e){this.view[t++]=e}.bind(this)),i?(this.offset=t,this):t-n},r.writeString=r.writeUTF8String,t.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(s(e))[0]},t.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(s(e))[1]},t.calculateString=t.calculateUTF8Bytes,r.readUTF8String=function(e,r,i){"number"==typeof r&&(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),void 0===r&&(r=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var s,a=0,u=i;if(r===t.METRICS_CHARS){if(s=o(),l.decodeUTF8(function(){return a>>=0)<0||i+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+"+e+") <= "+this.buffer.byteLength)}var h=i+e;if(l.decodeUTF8toUTF16(function(){return i>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var n,o,a=r;n=l.calculateUTF16asUTF8(s(e),this.noAssert)[1],o=t.calculateVarint32(n),r+=o+n;var u=this.buffer.byteLength;if(r>u&&this.resize((u*=2)>r?u:r),r-=o+n,r+=this.writeVarint32(n,r),l.encodeUTF16toUTF8(s(e),function(e){this.view[r++]=e}.bind(this)),r!==a+n+o)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+n+o));return i?(this.offset=r,this):r-a},r.readVString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i=e,n=this.readVarint32(e),s=this.readUTF8String(n.value,t.METRICS_BYTES,e+=n.length);return e+=s.length,r?(this.offset=e,s.string):{string:s.string,length:e-i}},r.append=function(e,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var s=e.limit-e.offset;if(s<=0)return this;i+=s;var o=this.buffer.byteLength;return i>o&&this.resize((o*=2)>i?o:i),i-=s,this.view.set(e.view.subarray(e.offset,e.limit),i),e.offset+=s,n&&(this.offset+=s),this},r.appendTo=function(e,t){return e.append(this,t),this},r.assert=function(e){return this.noAssert=!e,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(e){var r=new t(0,this.littleEndian,this.noAssert);return e?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var r=t-e;if(0===r)return this.buffer=i,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var n=new ArrayBuffer(r),s=new Uint8Array(n);return s.set(this.view.subarray(e,t)),this.buffer=n,this.view=s,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this},r.copy=function(e,r){if(void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e===r)return new t(0,this.littleEndian,this.noAssert);var i=r-e,n=new t(i,this.littleEndian,this.noAssert);return n.offset=0,n.limit=i,n.markedOffset>=0&&(n.markedOffset-=e),this.copyTo(n,0,e,r),n},r.copyTo=function(e,r,i,n){var s,o;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(o=void 0===r)?e.offset:0|r,i=(s=void 0===i)?this.offset:0|i,n=void 0===n?this.limit:0|n,r<0||r>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+e.buffer.byteLength);if(i<0||n>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+i+" <= "+this.buffer.byteLength);var a=n-i;return 0===a?e:(e.ensureCapacity(r+a),e.view.set(this.view.subarray(i,n),r),s&&(this.offset+=a),o&&(e.offset+=a),this)},r.ensureCapacity=function(e){var t=this.buffer.byteLength;return te?t:e):this},r.fill=function(e,t,r){var i=void 0===t;if(i&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;t>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},r.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},r.LE=function(e){return this.littleEndian=void 0===e||!!e,this},r.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},r.prepend=function(e,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var s=e.limit-e.offset;if(s<=0)return this;var o=s-i;if(o>0){var a=new ArrayBuffer(this.buffer.byteLength+o),u=new Uint8Array(a);u.set(this.view.subarray(i,this.buffer.byteLength),s),this.buffer=a,this.view=u,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,i+=o}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),i-s),e.offset=e.limit,n&&(this.offset-=s),this},r.prependTo=function(e,t){return e.prepend(this,t),this},r.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},r.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},r.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},r.toBuffer=function(e){var t=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(!e&&0===t&&r===this.buffer.byteLength)return this.buffer;if(t===r)return i;var n=new ArrayBuffer(r-t);return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t,r),0),n},r.toArrayBuffer=r.toBuffer,r.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var h=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],i=0,n=t.length;i>2&63]),n=(3&i)<<4,null!==(i=e())?(r(t[63&((n|=i>>4&15)|i>>4&15)]),n=(15&i)<<2,null!==(i=e())?(r(t[63&(n|i>>6&3)]),r(t[63&i])):(r(t[63&n]),r(61))):(r(t[63&n]),r(61),r(61))},e.decode=function(e,t){var i,n,s;function o(e){throw Error("Illegal character code: "+e)}for(;null!==(i=e());)if(void 0===(n=r[i])&&o(i),null!==(i=e())&&(void 0===(s=r[i])&&o(i),t(n<<2>>>0|(48&s)>>4),null!==(i=e()))){if(void 0===(n=r[i])){if(61===i)break;o(i)}if(t((15&s)<<4>>>0|(60&n)>>2),null!==(i=e())){if(void 0===(s=r[i])){if(61===i)break;o(i)}t((3&n)<<6>>>0|s)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();r.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return h.encode(function(){return ethis.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var r=[],i=[];e=1024&&(i.push(String.fromCharCode.apply(String,r)),r=[]);return i.join("")+String.fromCharCode.apply(String,r)},t.fromBinary=function(e,r){if("string"!=typeof e)throw TypeError("str");for(var i,n=0,s=e.length,o=new t(s,r);n255)throw RangeError("illegal char code: "+i);o.view[n++]=i}return o.limit=s,o},r.toDebug=function(e){for(var t,r=-1,i=this.buffer.byteLength,n="",s="",o="";r32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==i){for(;n.length<51;)n+=" ";o+=n+s+"\n",n=s=""}r===this.offset&&r===this.limit?n+=r===this.markedOffset?"!":"|":r===this.offset?n+=r===this.markedOffset?"[":"<":r===this.limit?n+=r===this.markedOffset?"]":">":n+=r===this.markedOffset?"'":e||0!==r&&r!==i?" ":""}if(e&&" "!==n){for(;n.length<51;)n+=" ";o+=n+s+"\n"}return e?o:n},t.fromDebug=function(e,r,i){for(var n,s,o=e.length,a=new t((o+1)/3|0,r,i),u=0,h=0,l=!1,d=!1,c=!1,f=!1,p=!1;u":if(!i){if(f){p=!0;break}f=!0}a.limit=h,l=!1;break;case"'":if(!i){if(c){p=!0;break}c=!0}a.markedOffset=h,l=!1;break;case" ":l=!1;break;default:if(!i&&l){p=!0;break}if(s=parseInt(n+e.charAt(u++),16),!i&&(isNaN(s)||s<0||s>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[h++]=s,l=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!i){if(!d||!f)throw TypeError("Illegal str: Missing offset or limit");if(h>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r,i=new Array(t-e);e255))throw TypeError("Illegal str: Contains non-hex characters");o.view[u++]=n}return o.limit=u,o};var l=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(r>>6&31|192),t(63&r|128)):r<65536?(t(r>>12&15|224),t(r>>6&63|128),t(63&r|128)):(t(r>>18&7|240),t(r>>12&63|128),t(r>>6&63|128),t(63&r|128)),r=null},decodeUTF8:function(e,t){for(var r,i,n,s,o=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(0==(128&r))t(r);else if(192==(224&r))null===(i=e())&&o([r,i]),t((31&r)<<6|63&i);else if(224==(240&r))(null===(i=e())||null===(n=e()))&&o([r,i,n]),t((15&r)<<12|(63&i)<<6|63&n);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(i=e())||null===(n=e())||null===(s=e()))&&o([r,i,n,s]),t((7&r)<<18|(63&i)<<12|(63&n)<<6|63&s)}},UTF16toUTF8:function(e,t){for(var r,i=null;null!==(r=null!==i?i:e());)r>=55296&&r<=57343&&null!==(i=e())&&i>=56320&&i<=57343?(t(1024*(r-55296)+i-56320+65536),i=null):t(r);null!==i&&t(i)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,r)}))},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,r)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,i=0;return e.UTF16toUTF8(t,(function(e){++r,i+=e<128?1:e<2048?2:e<65536?3:4})),[r,i]}};return e}();return r.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{l.decodeUTF8toUTF16(function(){return e + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/long.js for details + */i=[],void 0===(n="function"==typeof(r=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},i={};function n(e,t){var n,s,a;return t?(a=0<=(e>>>=0)&&e<256)&&(s=i[e])?s:(n=o(e,(0|e)<0?-1:0,!0),a&&(i[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(s=r[e])?s:(n=o(e,e<0?-1:0,!1),a&&(r[e]=n),n)}function s(e,t){if(isNaN(e)||!isFinite(e))return t?b:m;if(t){if(e<0)return b;if(e>=c)return _}else{if(e<=-f)return M;if(e+1>=f)return w}return e<0?s(-e,t).neg():o(e%d|0,e/d|0,t)}function o(t,r,i){return new e(t,r,i)}e.fromInt=n,e.fromNumber=s,e.fromBits=o;var a=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return m;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,r).neg();for(var n=s(a(r,8)),o=m,h=0;h>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},E.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((o=h).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(M)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},E.isOdd=function(){return 1==(1&this.low)},E.isEven=function(){return 0==(1&this.low)},E.equals=function(e){return t(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},E.eq=E.equals,E.notEquals=function(e){return!this.eq(e)},E.neq=E.notEquals,E.lessThan=function(e){return this.comp(e)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(e){return this.comp(e)<=0},E.lte=E.lessThanOrEqual,E.greaterThan=function(e){return this.comp(e)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(e){return this.comp(e)>=0},E.gte=E.greaterThanOrEqual,E.compare=function(e){if(t(e)||(e=h(e)),this.eq(e))return 0;var r=this.isNegative(),i=e.isNegative();return r&&!i?-1:!r&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(M)?M:this.not().add(g)},E.neg=E.negate,E.add=function(e){t(e)||(e=h(e));var r=this.high>>>16,i=65535&this.high,n=this.low>>>16,s=65535&this.low,a=e.high>>>16,u=65535&e.high,l=e.low>>>16,d=0,c=0,f=0,p=0;return f+=(p+=s+(65535&e.low))>>>16,c+=(f+=n+l)>>>16,d+=(c+=i+u)>>>16,d+=r+a,o((f&=65535)<<16|(p&=65535),(d&=65535)<<16|(c&=65535),this.unsigned)},E.subtract=function(e){return t(e)||(e=h(e)),this.add(e.neg())},E.sub=E.subtract,E.multiply=function(e){if(this.isZero())return m;if(t(e)||(e=h(e)),e.isZero())return m;if(this.eq(M))return e.isOdd()?M:m;if(e.eq(M))return this.isOdd()?M:m;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(p)&&e.lt(p))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,n=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,d=e.low>>>16,c=65535&e.low,f=0,b=0,g=0,y=0;return g+=(y+=a*c)>>>16,b+=(g+=n*c)>>>16,g&=65535,b+=(g+=a*d)>>>16,f+=(b+=i*c)>>>16,b&=65535,f+=(b+=n*d)>>>16,b&=65535,f+=(b+=a*l)>>>16,f+=r*c+i*d+n*l+a*u,o((g&=65535)<<16|(y&=65535),(f&=65535)<<16|(b&=65535),this.unsigned)},E.mul=E.multiply,E.divide=function(e){if(t(e)||(e=h(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?b:m;var r,i,n;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return y;n=b}else{if(this.eq(M))return e.eq(g)||e.eq(v)?M:e.eq(M)?g:(r=this.shr(1).div(e).shl(1)).eq(m)?e.isNegative()?g:v:(i=this.sub(e.mul(r)),n=r.add(i.div(e)));if(e.eq(M))return this.unsigned?b:m;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();n=m}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),u=o<=48?1:a(2,o-48),l=s(r),d=l.mul(e);d.isNegative()||d.gt(i);)d=(l=s(r-=u,this.unsigned)).mul(e);l.isZero()&&(l=g),n=n.add(l),i=i.sub(d)}return n},E.div=E.divide,E.modulo=function(e){return t(e)||(e=h(e)),this.sub(this.div(e).mul(e))},E.mod=E.modulo,E.not=function(){return o(~this.low,~this.high,this.unsigned)},E.and=function(e){return t(e)||(e=h(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},E.or=function(e){return t(e)||(e=h(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},E.xor=function(e){return t(e)||(e=h(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},E.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<>>32-e,this.unsigned):o(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},E.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},E.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?r.apply(t,i):r)||(e.exports=n)},"../../node_modules/cashaddrjs/node_modules/big-integer/BigInteger.js":(e,t,r)=>{var i;e=r.nmd(e);var n=function(e){"use strict";var t=1e7,r=7,i=9007199254740992,s=l(i),o=Math.log(i);function a(e,t){return void 0===e?a[0]:void 0!==t?10==+t?Z(e):H(e,t):Z(e)}function BigInteger(e,t){this.value=e,this.sign=t,this.isSmall=!1}function u(e){this.value=e,this.sign=e<0,this.isSmall=!0}function h(e){return-i0?Math.floor(e):Math.ceil(e)}function m(e,r){var i,n,s=e.length,o=r.length,a=new Array(s),u=0,h=t;for(n=0;n=h?1:0,a[n]=i-u*h;for(;n0&&a.push(u),a}function b(e,t){return e.length>=t.length?m(e,t):m(t,e)}function g(e,r){var i,n,s=e.length,o=new Array(s),a=t;for(n=0;n0;)o[n++]=r%a,r=Math.floor(r/a);return o}function y(e,r){var i,n,s=e.length,o=r.length,a=new Array(s),u=0,h=t;for(i=0;i0;)o[n++]=u%a,u=Math.floor(u/a);return o}function M(e,t){for(var r=[];t-- >0;)r.push(0);return r.concat(e)}function E(e,t){var r=Math.max(e.length,t.length);if(r<=30)return w(e,t);r=Math.ceil(r/2);var i=e.slice(r),n=e.slice(0,r),s=t.slice(r),o=t.slice(0,r),a=E(n,o),u=E(i,s),h=E(b(n,i),b(o,s)),l=b(b(a,M(y(y(h,a),u),r)),M(u,2*r));return c(l),l}function S(e,r,i){return new BigInteger(e=0;--i)s=(o=s*h+e[i])-(n=p(o/r))*r,u[i]=0|n;return[u,0|s]}function O(e,r){var i,n,s=Z(r),o=e.value,h=s.value;if(0===h)throw new Error("Cannot divide by zero");if(e.isSmall)return s.isSmall?[new u(p(o/h)),new u(o%h)]:[a[0],e];if(s.isSmall){if(1===h)return[e,a[0]];if(-1==h)return[e.negate(),a[0]];var m=Math.abs(h);if(m=0;n--){for(i=p-1,y[n+c]!==b&&(i=Math.floor((y[n+c]*p+y[n+c-1])/b)),s=0,o=0,u=v.length,a=0;ah&&(s=(s+1)*p),i=Math.ceil(s/o);do{if(A(a=_(r,i),f)<=0)break;i--}while(i);l.push(i),f=y(f,a)}return l.reverse(),[d(l),d(f)]}(o,h),n=i[0];var v=e.sign!==s.sign,w=i[1],M=e.sign;return"number"==typeof n?(v&&(n=-n),n=new u(n)):n=new BigInteger(n,v),"number"==typeof w?(M&&(w=-w),w=new u(w)):w=new BigInteger(w,M),[n,w]}function A(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var r=e.length-1;r>=0;r--)if(e[r]!==t[r])return e[r]>t[r]?1:-1;return 0}function j(e){var t=e.abs();return!t.isUnit()&&(!!(t.equals(2)||t.equals(3)||t.equals(5))||!(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))&&(!!t.lesser(49)||void 0))}function k(e,t){for(var r,i,s,o=e.prev(),u=o,h=0;u.isEven();)u=u.divide(2),h++;e:for(i=0;i=0?i=y(e,t):(i=y(t,e),r=!r),"number"==typeof(i=d(i))?(r&&(i=-i),new u(i)):new BigInteger(i,r)}(r,i,this.sign)},BigInteger.prototype.minus=BigInteger.prototype.subtract,u.prototype.subtract=function(e){var t=Z(e),r=this.value;if(r<0!==t.sign)return this.add(t.negate());var i=t.value;return t.isSmall?new u(r-i):v(i,Math.abs(r),r>=0)},u.prototype.minus=u.prototype.subtract,BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)},u.prototype.negate=function(){var e=this.sign,t=new u(-this.value);return t.sign=!e,t},BigInteger.prototype.abs=function(){return new BigInteger(this.value,!1)},u.prototype.abs=function(){return new u(Math.abs(this.value))},BigInteger.prototype.multiply=function(e){var r,i,n,s=Z(e),o=this.value,u=s.value,h=this.sign!==s.sign;if(s.isSmall){if(0===u)return a[0];if(1===u)return this;if(-1===u)return this.negate();if((r=Math.abs(u))0?E(o,u):w(o,u),h)},BigInteger.prototype.times=BigInteger.prototype.multiply,u.prototype._multiplyBySmall=function(e){return h(e.value*this.value)?new u(e.value*this.value):S(Math.abs(e.value),l(Math.abs(this.value)),this.sign!==e.sign)},BigInteger.prototype._multiplyBySmall=function(e){return 0===e.value?a[0]:1===e.value?this:-1===e.value?this.negate():S(Math.abs(e.value),this.value,this.sign!==e.sign)},u.prototype.multiply=function(e){return Z(e)._multiplyBySmall(this)},u.prototype.times=u.prototype.multiply,BigInteger.prototype.square=function(){return new BigInteger(T(this.value),!1)},u.prototype.square=function(){var e=this.value*this.value;return h(e)?new u(e):new BigInteger(T(l(Math.abs(this.value))),!1)},BigInteger.prototype.divmod=function(e){var t=O(this,e);return{quotient:t[0],remainder:t[1]}},u.prototype.divmod=BigInteger.prototype.divmod,BigInteger.prototype.divide=function(e){return O(this,e)[0]},u.prototype.over=u.prototype.divide=BigInteger.prototype.over=BigInteger.prototype.divide,BigInteger.prototype.mod=function(e){return O(this,e)[1]},u.prototype.remainder=u.prototype.mod=BigInteger.prototype.remainder=BigInteger.prototype.mod,BigInteger.prototype.pow=function(e){var t,r,i,n=Z(e),s=this.value,o=n.value;if(0===o)return a[1];if(0===s)return a[0];if(1===s)return a[1];if(-1===s)return n.isEven()?a[1]:a[-1];if(n.sign)return a[0];if(!n.isSmall)throw new Error("The exponent "+n.toString()+" is too large.");if(this.isSmall&&h(t=Math.pow(s,o)))return new u(p(t));for(r=this,i=a[1];!0&o&&(i=i.times(r),--o),0!==o;)o/=2,r=r.square();return i},u.prototype.pow=BigInteger.prototype.pow,BigInteger.prototype.modPow=function(e,t){if(e=Z(e),(t=Z(t)).isZero())throw new Error("Cannot take modPow with modulus 0");for(var r=a[1],i=this.mod(t);e.isPositive();){if(i.isZero())return a[0];e.isOdd()&&(r=r.multiply(i).mod(t)),e=e.divide(2),i=i.square().mod(t)}return r},u.prototype.modPow=BigInteger.prototype.modPow,BigInteger.prototype.compareAbs=function(e){var t=Z(e),r=this.value,i=t.value;return t.isSmall?1:A(r,i)},u.prototype.compareAbs=function(e){var t=Z(e),r=Math.abs(this.value),i=t.value;return t.isSmall?r===(i=Math.abs(i))?0:r>i?1:-1:-1},BigInteger.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=Z(e),r=this.value,i=t.value;return this.sign!==t.sign?t.sign?1:-1:t.isSmall?this.sign?-1:1:A(r,i)*(this.sign?-1:1)},BigInteger.prototype.compareTo=BigInteger.prototype.compare,u.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=Z(e),r=this.value,i=t.value;return t.isSmall?r==i?0:r>i?1:-1:r<0!==t.sign?r<0?-1:1:r<0?1:-1},u.prototype.compareTo=u.prototype.compare,BigInteger.prototype.equals=function(e){return 0===this.compare(e)},u.prototype.eq=u.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals,BigInteger.prototype.notEquals=function(e){return 0!==this.compare(e)},u.prototype.neq=u.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals,BigInteger.prototype.greater=function(e){return this.compare(e)>0},u.prototype.gt=u.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater,BigInteger.prototype.lesser=function(e){return this.compare(e)<0},u.prototype.lt=u.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser,BigInteger.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},u.prototype.geq=u.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals,BigInteger.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},u.prototype.leq=u.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals,BigInteger.prototype.isEven=function(){return 0==(1&this.value[0])},u.prototype.isEven=function(){return 0==(1&this.value)},BigInteger.prototype.isOdd=function(){return 1==(1&this.value[0])},u.prototype.isOdd=function(){return 1==(1&this.value)},BigInteger.prototype.isPositive=function(){return!this.sign},u.prototype.isPositive=function(){return this.value>0},BigInteger.prototype.isNegative=function(){return this.sign},u.prototype.isNegative=function(){return this.value<0},BigInteger.prototype.isUnit=function(){return!1},u.prototype.isUnit=function(){return 1===Math.abs(this.value)},BigInteger.prototype.isZero=function(){return!1},u.prototype.isZero=function(){return 0===this.value},BigInteger.prototype.isDivisibleBy=function(e){var t=Z(e),r=t.value;return 0!==r&&(1===r||(2===r?this.isEven():this.mod(t).equals(a[0])))},u.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy,BigInteger.prototype.isPrime=function(t){var r=j(this);if(r!==e)return r;var i=this.abs(),s=i.bitLength();if(s<=64)return k(i,[2,325,9375,28178,450775,9780504,1795265022]);for(var o=Math.log(2)*s,a=Math.ceil(!0===t?2*Math.pow(o,2):o),u=[],h=0;h-i?new u(e-1):new BigInteger(s,!0)};for(var x=[1];2*x[x.length-1]<=t;)x.push(2*x[x.length-1]);var R=x.length,P=x[R-1];function N(e){return("number"==typeof e||"string"==typeof e)&&+Math.abs(e)<=t||e instanceof BigInteger&&e.value.length<=1}function C(e,t,r){t=Z(t);for(var i=e.isNegative(),s=t.isNegative(),o=i?e.not():e,a=s?t.not():t,u=0,h=0,l=null,d=null,c=[];!o.isZero()||!a.isZero();)u=(l=O(o,P))[1].toJSNumber(),i&&(u=P-1-u),h=(d=O(a,P))[1].toJSNumber(),s&&(h=P-1-h),o=l[0],a=d[0],c.push(r(u,h));for(var f=0!==r(i?1:0,s?1:0)?n(-1):n(0),p=c.length-1;p>=0;p-=1)f=f.multiply(P).add(n(c[p]));return f}BigInteger.prototype.shiftLeft=function(e){if(!N(e))throw new Error(String(e)+" is too large for shifting.");if((e=+e)<0)return this.shiftRight(-e);var t=this;if(t.isZero())return t;for(;e>=R;)t=t.multiply(P),e-=R-1;return t.multiply(x[e])},u.prototype.shiftLeft=BigInteger.prototype.shiftLeft,BigInteger.prototype.shiftRight=function(e){var t;if(!N(e))throw new Error(String(e)+" is too large for shifting.");if((e=+e)<0)return this.shiftLeft(-e);for(var r=this;e>=R;){if(r.isZero()||r.isNegative()&&r.isUnit())return r;r=(t=O(r,P))[1].isNegative()?t[0].prev():t[0],e-=R-1}return(t=O(r,x[e]))[1].isNegative()?t[0].prev():t[0]},u.prototype.shiftRight=BigInteger.prototype.shiftRight,BigInteger.prototype.not=function(){return this.negate().prev()},u.prototype.not=BigInteger.prototype.not,BigInteger.prototype.and=function(e){return C(this,e,(function(e,t){return e&t}))},u.prototype.and=BigInteger.prototype.and,BigInteger.prototype.or=function(e){return C(this,e,(function(e,t){return e|t}))},u.prototype.or=BigInteger.prototype.or,BigInteger.prototype.xor=function(e){return C(this,e,(function(e,t){return e^t}))},u.prototype.xor=BigInteger.prototype.xor;var B=1<<30,U=(t&-t)*(t&-t)|B;function D(e){var r=e.value,i="number"==typeof r?r|B:r[0]+r[1]*t|U;return i&-i}function L(e,t){if(t.compareTo(e)<=0){var r=L(e,t.square(t)),i=r.p,s=r.e,o=i.multiply(t);return o.compareTo(e)<=0?{p:o,e:2*s+1}:{p:i,e:2*s}}return{p:n(1),e:0}}function q(e,t){return e=Z(e),t=Z(t),e.greater(t)?e:t}function F(e,t){return e=Z(e),t=Z(t),e.lesser(t)?e:t}function z(e,t){if(e=Z(e).abs(),t=Z(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var r,i,n=a[1];e.isEven()&&t.isEven();)r=Math.min(D(e),D(t)),e=e.divide(r),t=t.divide(r),n=n.multiply(r);for(;e.isEven();)e=e.divide(D(e));do{for(;t.isEven();)t=t.divide(D(t));e.greater(t)&&(i=t,t=e,e=i),t=t.subtract(e)}while(!t.isZero());return n.isUnit()?e:e.multiply(n)}BigInteger.prototype.bitLength=function(){var e=this;return e.compareTo(n(0))<0&&(e=e.negate().subtract(n(1))),0===e.compareTo(n(0))?n(0):n(L(e,n(2)).e).add(n(1))},u.prototype.bitLength=BigInteger.prototype.bitLength;var H=function(e,t){for(var r=e.length,i=Math.abs(t),n=0;n=i){if("1"===l&&1===i)continue;throw new Error(l+" is not a valid digit in base "+t+".")}if(l.charCodeAt(0)-87>=i)throw new Error(l+" is not a valid digit in base "+t+".")}}if(2<=t&&t<=36&&r<=o/Math.log(t)){var s=parseInt(e,t);if(isNaN(s))throw new Error(l+" is not a valid digit in base "+t+".");return new u(parseInt(e,t))}t=Z(t);var a=[],h="-"===e[0];for(n=h?1:0;n"!==e[n]);a.push(Z(e.slice(c+1,n)))}}return V(a,t,h)};function V(e,t,r){var i,n=a[0],s=a[1];for(i=e.length-1;i>=0;i--)n=n.add(e[i].times(s)),s=s.times(t);return r?n.negate():n}function G(e){return e<=35?"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e):"<"+e+">"}function W(e,t){if((t=n(t)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(t.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e)).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(+e-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var i=!1;if(e.isNegative()&&t.isPositive()&&(i=!0,e=e.abs()),t.equals(1))return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(+e)).map(Number.prototype.valueOf,1),isNegative:i};for(var s,o=[],a=e;a.isNegative()||a.compareAbs(t)>=0;){s=a.divmod(t),a=s.quotient;var u=s.remainder;u.isNegative()&&(u=t.minus(u).abs(),a=a.next()),o.push(u.toJSNumber())}return o.push(a.toJSNumber()),{value:o.reverse(),isNegative:i}}function K(e,t){var r=W(e,t);return(r.isNegative?"-":"")+r.value.map(G).join("")}function $(e){if(h(+e)){var t=+e;if(t===p(t))return new u(t);throw new Error("Invalid integer: "+e)}var i="-"===e[0];i&&(e=e.slice(1));var n=e.split(/e/i);if(n.length>2)throw new Error("Invalid integer: "+n.join("e"));if(2===n.length){var s=n[1];if("+"===s[0]&&(s=s.slice(1)),(s=+s)!==p(s)||!h(s))throw new Error("Invalid integer: "+s+" is not a valid exponent.");var o=n[0],a=o.indexOf(".");if(a>=0&&(s-=o.length-a-1,o=o.slice(0,a)+o.slice(a+1)),s<0)throw new Error("Cannot include negative exponent part for integers");e=o+=new Array(s+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);for(var l=[],d=e.length,f=r,m=d-f;d>0;)l.push(+e.slice(m,d)),(m-=f)<0&&(m=0),d-=f;return c(l),new BigInteger(l,i)}function Z(e){return"number"==typeof e?function(e){if(h(e)){if(e!==p(e))throw new Error(e+" is not an integer.");return new u(e)}return $(e.toString())}(e):"string"==typeof e?$(e):e}BigInteger.prototype.toArray=function(e){return W(this,e)},u.prototype.toArray=function(e){return W(this,e)},BigInteger.prototype.toString=function(t){if(t===e&&(t=10),10!==t)return K(this,t);for(var r,i=this.value,n=i.length,s=String(i[--n]);--n>=0;)r=String(i[n]),s+="0000000".slice(r.length)+r;return(this.sign?"-":"")+s},u.prototype.toString=function(t){return t===e&&(t=10),10!=t?K(this,t):String(this.value)},BigInteger.prototype.toJSON=u.prototype.toJSON=function(){return this.toString()},BigInteger.prototype.valueOf=function(){return parseInt(this.toString(),10)},BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf,u.prototype.valueOf=function(){return this.value},u.prototype.toJSNumber=u.prototype.valueOf;for(var Y=0;Y<1e3;Y++)a[Y]=new u(Y),Y>0&&(a[-Y]=new u(-Y));return a.one=a[1],a.zero=a[0],a.minusOne=a[-1],a.max=q,a.min=F,a.gcd=z,a.lcm=function(e,t){return e=Z(e).abs(),t=Z(t).abs(),e.divide(z(e,t)).multiply(t)},a.isInstance=function(e){return e instanceof BigInteger||e instanceof u},a.randBetween=function(e,r){var i=F(e=Z(e),r=Z(r)),n=q(e,r).subtract(i).add(1);if(n.isSmall)return i.add(Math.floor(Math.random()*n));for(var s=[],o=!0,a=n.value.length-1;a>=0;a--){var h=o?n.value[a]:t,l=p(Math.random()*h);s.unshift(l),l{"use strict"; +/** + * @license + * https://github.com/ealmansi/cashaddrjs + * Copyright (c) 2017-2020 Emilio Almansi + * Distributed under the MIT software license, see the accompanying + * file LICENSE or http://www.opensource.org/licenses/mit-license.php. + */var i=r("../../node_modules/cashaddrjs/src/validation.js").validate,n={q:0,p:1,z:2,r:3,y:4,9:5,x:6,8:7,g:8,f:9,2:10,t:11,v:12,d:13,w:14,0:15,s:16,3:17,j:18,n:19,5:20,4:21,k:22,h:23,c:24,e:25,6:26,m:27,u:28,a:29,7:30,l:31};e.exports={encode:function(e){i(e instanceof Uint8Array,"Invalid data: "+e+".");for(var t="",r=0;r{"use strict"; +/** + * @license + * https://github.com/ealmansi/cashaddrjs + * Copyright (c) 2017-2020 Emilio Almansi + * Distributed under the MIT software license, see the accompanying + * file LICENSE or http://www.opensource.org/licenses/mit-license.php. + */var i=r("../../node_modules/cashaddrjs/src/base32.js"),n=r("../../node_modules/cashaddrjs/node_modules/big-integer/BigInteger.js"),s=r("../../node_modules/cashaddrjs/src/convertBits.js"),o=r("../../node_modules/cashaddrjs/src/validation.js"),a=o.validate;var u=o.ValidationError,h=["bitcoincash","bchtest","bchreg"];function l(e){for(var t=new Uint8Array(e.length),r=0;r{"use strict";var i=r("../../node_modules/cashaddrjs/src/validation.js").validate;e.exports=function(e,t,r,n){for(var s=n?Math.floor(e.length*t/r):Math.ceil(e.length*t/r),o=(1<>t==0,"Invalid value: "+c+"."),h=h<=r;)l-=r,a[u]=h>>l&o,++u}return n?i(l0&&(a[u]=h<{"use strict"; +/** + * @license + * https://github.com/ealmansi/cashaddrjs + * Copyright (c) 2017-2020 Emilio Almansi + * Distributed under the MIT software license, see the accompanying + * file LICENSE or http://www.opensource.org/licenses/mit-license.php. + */function t(e){var t=new Error;this.name=t.name="ValidationError",this.message=t.message=e,this.stack=t.stack}t.prototype=Object.create(Error.prototype),e.exports={ValidationError:t,validate:function(e,r){if(!e)throw new t(r)}}},"../../node_modules/cipher-base/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/stream-browserify/index.js").Transform,n=r("../../node_modules/string_decoder/lib/string_decoder.js").s;function s(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r("../../node_modules/inherits/inherits_browser.js")(s,i),s.prototype.update=function(e,t,r){"string"==typeof e&&(e=Buffer.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||Buffer.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new n(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i},e.exports=s},"../../node_modules/create-ecdh/browser.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer,i=r("../../node_modules/elliptic/lib/elliptic.js"),n=r("../../node_modules/create-ecdh/node_modules/bn.js/lib/bn.js");e.exports=function(e){return new o(e)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function o(e){this.curveType=s[e],this.curveType||(this.curveType={name:e}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function a(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new Buffer(e);if(r&&i.length=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=a(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,u=o/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,t.length-1),f=Math.max(0,h-e.length+1);f<=c;f++){var p=h-f|0;l+=(o=(n=0|e.words[p])*(s=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o>>24-n&16777215)||o!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,u="le"===t,h=new e(s),l=this.clone();if(u){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),h[a]=o;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,f=0|o[1],p=8191&f,m=f>>>13,b=0|o[2],g=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,T=0|o[5],I=8191&T,O=T>>>13,A=0|o[6],j=8191&A,k=A>>>13,x=0|o[7],R=8191&x,P=x>>>13,N=0|o[8],C=8191&N,B=N>>>13,U=0|o[9],D=8191&U,L=U>>>13,q=0|a[0],F=8191&q,z=q>>>13,H=0|a[1],V=8191&H,G=H>>>13,W=0|a[2],K=8191&W,$=W>>>13,Z=0|a[3],Y=8191&Z,X=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,le=0|a[8],de=8191&le,ce=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,z))+Math.imul(c,F)|0))<<13)|0;h=((s=Math.imul(c,z))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,s=Math.imul(m,z);var ge=(h+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((s=s+Math.imul(c,G)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,s=Math.imul(y,z),i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,G)|0;var ye=(h+(i=i+Math.imul(d,K)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,K)|0))<<13)|0;h=((s=s+Math.imul(c,$)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(_,F)|0,s=Math.imul(_,z),i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,$)|0;var ve=(h+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,Y)|0))<<13)|0;h=((s=s+Math.imul(c,X)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(S,F)|0,s=Math.imul(S,z),i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(g,K)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,$)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,X)|0;var we=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(c,Q)|0))<<13)|0;h=((s=s+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(O,F)|0,s=Math.imul(O,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,$)|0,i=i+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((s=s+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(k,F)|0,s=Math.imul(k,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(O,V)|0,s=s+Math.imul(O,G)|0,i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,s=s+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(d,se)|0)|0)+((8191&(n=(n=n+Math.imul(d,oe)|0)+Math.imul(c,se)|0))<<13)|0;h=((s=s+Math.imul(c,oe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,z))+Math.imul(P,F)|0,s=Math.imul(P,z),i=i+Math.imul(j,V)|0,n=(n=n+Math.imul(j,G)|0)+Math.imul(k,V)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(O,K)|0,s=s+Math.imul(O,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0;var Ee=(h+(i=i+Math.imul(d,ue)|0)|0)+((8191&(n=(n=n+Math.imul(d,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((s=s+Math.imul(c,he)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,z))+Math.imul(B,F)|0,s=Math.imul(B,z),i=i+Math.imul(R,V)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,$)|0)+Math.imul(k,K)|0,s=s+Math.imul(k,$)|0,i=i+Math.imul(I,Y)|0,n=(n=n+Math.imul(I,X)|0)+Math.imul(O,Y)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(g,se)|0,n=(n=n+Math.imul(g,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,s=s+Math.imul(m,he)|0;var Se=(h+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ce)|0)+Math.imul(c,de)|0))<<13)|0;h=((s=s+Math.imul(c,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,z))+Math.imul(L,F)|0,s=Math.imul(L,z),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,G)|0,i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,K)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,X)|0)+Math.imul(k,Y)|0,s=s+Math.imul(k,X)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(w,se)|0,n=(n=n+Math.imul(w,oe)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(g,ue)|0,n=(n=n+Math.imul(g,he)|0)+Math.imul(y,ue)|0,s=s+Math.imul(y,he)|0,i=i+Math.imul(p,de)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,de)|0,s=s+Math.imul(m,ce)|0;var Te=(h+(i=i+Math.imul(d,pe)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((s=s+Math.imul(c,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,G))+Math.imul(L,V)|0,s=Math.imul(L,G),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,X)|0,i=i+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(O,re)|0,s=s+Math.imul(O,ie)|0,i=i+Math.imul(E,se)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,s=s+Math.imul(_,he)|0,i=i+Math.imul(g,de)|0,n=(n=n+Math.imul(g,ce)|0)+Math.imul(y,de)|0,s=s+Math.imul(y,ce)|0;var Ie=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((s=s+Math.imul(m,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,$))+Math.imul(L,K)|0,s=Math.imul(L,$),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(j,re)|0,n=(n=n+Math.imul(j,ie)|0)+Math.imul(k,re)|0,s=s+Math.imul(k,ie)|0,i=i+Math.imul(I,se)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(O,se)|0,s=s+Math.imul(O,oe)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(S,ue)|0,s=s+Math.imul(S,he)|0,i=i+Math.imul(w,de)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,de)|0,s=s+Math.imul(_,ce)|0;var Oe=(h+(i=i+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,me)|0)+Math.imul(y,pe)|0))<<13)|0;h=((s=s+Math.imul(y,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(L,Y)|0,s=Math.imul(L,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(j,se)|0,n=(n=n+Math.imul(j,oe)|0)+Math.imul(k,se)|0,s=s+Math.imul(k,oe)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(O,ue)|0,s=s+Math.imul(O,he)|0,i=i+Math.imul(E,de)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(S,de)|0,s=s+Math.imul(S,ce)|0;var Ae=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((s=s+Math.imul(_,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(L,Q)|0,s=Math.imul(L,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(B,re)|0,s=s+Math.imul(B,ie)|0,i=i+Math.imul(R,se)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(j,ue)|0,n=(n=n+Math.imul(j,he)|0)+Math.imul(k,ue)|0,s=s+Math.imul(k,he)|0,i=i+Math.imul(I,de)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(O,de)|0,s=s+Math.imul(O,ce)|0;var je=(h+(i=i+Math.imul(E,pe)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;h=((s=s+Math.imul(S,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(L,re)|0,s=Math.imul(L,ie),i=i+Math.imul(C,se)|0,n=(n=n+Math.imul(C,oe)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,oe)|0,i=i+Math.imul(R,ue)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(P,ue)|0,s=s+Math.imul(P,he)|0,i=i+Math.imul(j,de)|0,n=(n=n+Math.imul(j,ce)|0)+Math.imul(k,de)|0,s=s+Math.imul(k,ce)|0;var ke=(h+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((s=s+Math.imul(O,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,se),n=(n=Math.imul(D,oe))+Math.imul(L,se)|0,s=Math.imul(L,oe),i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(B,ue)|0,s=s+Math.imul(B,he)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,ce)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,ce)|0;var xe=(h+(i=i+Math.imul(j,pe)|0)|0)+((8191&(n=(n=n+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((s=s+Math.imul(k,me)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(D,ue),n=(n=Math.imul(D,he))+Math.imul(L,ue)|0,s=Math.imul(L,he),i=i+Math.imul(C,de)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,ce)|0;var Re=(h+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((s=s+Math.imul(P,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,de),n=(n=Math.imul(D,ce))+Math.imul(L,de)|0,s=Math.imul(L,ce);var Pe=(h+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((s=s+Math.imul(B,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(h+(i=Math.imul(D,pe))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(L,pe)|0))<<13)|0;return h=((s=Math.imul(L,me))+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=be,u[1]=ge,u[2]=ye,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Ee,u[8]=Se,u[9]=Te,u[10]=Ie,u[11]=Oe,u[12]=Ae,u[13]=je,u[14]=ke,u[15]=xe,u[16]=Re,u[17]=Pe,u[18]=Ne,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=c),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i>=1;return i},m.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=s>>>26,this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-s|d>>>s,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==t){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/o|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return b[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(e,n.addn(1).iushrn(1)),f=this.pow(e,n),p=o;0!==f.cmp(a);){for(var m=f,b=0;0!==m.cmp(a);b++)m=m.redSqr();i(b=0;i--){for(var h=t.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}u=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},n(E,M),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/create-hash/browser.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/md5.js/index.js"),s=r("../../node_modules/ripemd160/index.js"),o=r("../../node_modules/sha.js/index.js"),a=r("../../node_modules/cipher-base/index.js");function u(e){a.call(this,"digest"),this._hash=e}i(u,a),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new n:"rmd160"===e||"ripemd160"===e?new s:new u(o(e))}},"../../node_modules/create-hash/md5.js":(e,t,r)=>{var i=r("../../node_modules/md5.js/index.js");e.exports=function(e){return(new i).update(e).digest()}},"../../node_modules/create-hmac/browser.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/create-hmac/legacy.js"),s=r("../../node_modules/cipher-base/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=r("../../node_modules/create-hash/md5.js"),a=r("../../node_modules/ripemd160/index.js"),u=r("../../node_modules/sha.js/index.js"),h=Buffer.alloc(128);function l(e,t){s.call(this,"digest"),"string"==typeof t&&(t=Buffer.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new a:u(e)).update(t).digest():t.length{"use strict";var i=r("../../node_modules/inherits/inherits_browser.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/cipher-base/index.js"),s=Buffer.alloc(128),o=64;function a(e,t){n.call(this,"digest"),"string"==typeof t&&(t=Buffer.from(t)),this._alg=e,this._key=t,t.length>o?t=e(t):t.length-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return i.reject(new TypeError("Already read"));e.bodyUsed=!0}function m(e){return new i((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function b(e){var t=new FileReader,r=m(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:s&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&s&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||h(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return i.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return i.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return i.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||i.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=m(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return i.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),i=0;i-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(n))}})),t}function M(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},y.call(w.prototype),y.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},M.error=function(){var e=new M(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];M.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new M(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,r){return new i((function(i,n){var o=new w(e,r);if(o.signal&&o.signal.aborted)return n(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();t.append(i,n)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;i(new M(n,r))},a.onerror=function(){n(new TypeError("Network request failed"))},a.ontimeout=function(){n(new TypeError("Network request failed"))},a.onabort=function(){n(new t.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&s&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",u)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=f,e.Request=w,e.Response=M),t.Headers=f,t.Request=w,t.Response=M,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var o=s;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},"../../node_modules/crypto-browserify/index.js":(e,t,r)=>{"use strict";t.O6=r("../../node_modules/randombytes/browser.js"),r("../../node_modules/create-hash/browser.js"),r("../../node_modules/create-hmac/browser.js");var i=r("../../node_modules/browserify-sign/algos.js"),n=Object.keys(i),s=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);var o=r("../../node_modules/pbkdf2/browser.js");o.pbkdf2,o.pbkdf2Sync;var a=r("../../node_modules/browserify-cipher/browser.js");a.Cipher,a.createCipher,a.Cipheriv,a.createCipheriv,a.Decipher,a.createDecipher,a.Decipheriv,a.createDecipheriv,a.getCiphers,a.listCiphers;var u=r("../../node_modules/diffie-hellman/browser.js");u.DiffieHellmanGroup,u.createDiffieHellmanGroup,u.getDiffieHellman,u.createDiffieHellman,u.DiffieHellman;var h=r("../../node_modules/browserify-sign/browser/index.js");h.createSign,h.Sign,h.createVerify,h.Verify,r("../../node_modules/create-ecdh/browser.js");var l=r("../../node_modules/public-encrypt/browser.js");l.publicEncrypt,l.privateEncrypt,l.publicDecrypt,l.privateDecrypt;var d=r("../../node_modules/randomfill/browser.js");d.randomFill,d.randomFillSync},"../../node_modules/des.js/lib/des.js":(e,t,r)=>{"use strict";t.utils=r("../../node_modules/des.js/lib/des/utils.js"),t.Cipher=r("../../node_modules/des.js/lib/des/cipher.js"),t.DES=r("../../node_modules/des.js/lib/des/des.js"),t.CBC=r("../../node_modules/des.js/lib/des/cbc.js"),t.EDE=r("../../node_modules/des.js/lib/des/ede.js")},"../../node_modules/des.js/lib/des/cbc.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/minimalistic-assert/index.js"),n=r("../../node_modules/inherits/inherits_browser.js"),s={};function o(e){i.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t{"use strict";var i=r("../../node_modules/minimalistic-assert/index.js");function n(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=n,n.prototype._init=function(){},n.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},n.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),i=0;i0;i--)t+=this._buffer(e,t),r+=this._flushBuffer(n,r);return t+=this._buffer(e,t),n},n.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},n.prototype._pad=function(e,t){if(0===t)return!1;for(;t{"use strict";var i=r("../../node_modules/minimalistic-assert/index.js"),n=r("../../node_modules/inherits/inherits_browser.js"),s=r("../../node_modules/des.js/lib/des/utils.js"),o=r("../../node_modules/des.js/lib/des/cipher.js");function a(){this.tmp=new Array(2),this.keys=null}function u(e){o.call(this,e);var t=new a;this._desState=t,this.deriveKeys(t,e.key)}n(u,o),e.exports=u,u.create=function(e){return new u(e)};var h=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(e,t){e.keys=new Array(32),i.equal(t.length,this.blockSize,"Invalid key length");var r=s.readUInt32BE(t,0),n=s.readUInt32BE(t,4);s.pc1(r,n,e.tmp,0),r=e.tmp[0],n=e.tmp[1];for(var o=0;o>>1];r=s.r28shl(r,a),n=s.r28shl(n,a),s.pc2(r,n,e.keys,o)}},u.prototype._update=function(e,t,r,i){var n=this._desState,o=s.readUInt32BE(e,t),a=s.readUInt32BE(e,t+4);s.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],s.writeUInt32BE(r,o,i),s.writeUInt32BE(r,a,i+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,o=c}s.rip(a,o,i,n)},u.prototype._decrypt=function(e,t,r,i,n){for(var o=r,a=t,u=e.keys.length-2;u>=0;u-=2){var h=e.keys[u],l=e.keys[u+1];s.expand(o,e.tmp,0),h^=e.tmp[0],l^=e.tmp[1];var d=s.substitute(h,l),c=o;o=(a^s.permute(d))>>>0,a=c}s.rip(o,a,i,n)}},"../../node_modules/des.js/lib/des/ede.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/minimalistic-assert/index.js"),n=r("../../node_modules/inherits/inherits_browser.js"),s=r("../../node_modules/des.js/lib/des/cipher.js"),o=r("../../node_modules/des.js/lib/des/des.js");function a(e,t){i.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),n=t.slice(8,16),s=t.slice(16,24);this.ciphers="encrypt"===e?[o.create({type:"encrypt",key:r}),o.create({type:"decrypt",key:n}),o.create({type:"encrypt",key:s})]:[o.create({type:"decrypt",key:s}),o.create({type:"encrypt",key:n}),o.create({type:"decrypt",key:r})]}function u(e){s.call(this,e);var t=new a(this.type,this.options.key);this._edeState=t}n(u,s),e.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},u.prototype._pad=o.prototype._pad,u.prototype._unpad=o.prototype._unpad},"../../node_modules/des.js/lib/des/utils.js":(e,t)=>{"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,i){for(var n=0,s=0,o=6;o>=0;o-=2){for(var a=0;a<=24;a+=8)n<<=1,n|=t>>>a+o&1;for(a=0;a<=24;a+=8)n<<=1,n|=e>>>a+o&1}for(o=6;o>=0;o-=2){for(a=1;a<=25;a+=8)s<<=1,s|=t>>>a+o&1;for(a=1;a<=25;a+=8)s<<=1,s|=e>>>a+o&1}r[i+0]=n>>>0,r[i+1]=s>>>0},t.rip=function(e,t,r,i){for(var n=0,s=0,o=0;o<4;o++)for(var a=24;a>=0;a-=8)n<<=1,n|=t>>>a+o&1,n<<=1,n|=e>>>a+o&1;for(o=4;o<8;o++)for(a=24;a>=0;a-=8)s<<=1,s|=t>>>a+o&1,s<<=1,s|=e>>>a+o&1;r[i+0]=n>>>0,r[i+1]=s>>>0},t.pc1=function(e,t,r,i){for(var n=0,s=0,o=7;o>=5;o--){for(var a=0;a<=24;a+=8)n<<=1,n|=t>>a+o&1;for(a=0;a<=24;a+=8)n<<=1,n|=e>>a+o&1}for(a=0;a<=24;a+=8)n<<=1,n|=t>>a+o&1;for(o=1;o<=3;o++){for(a=0;a<=24;a+=8)s<<=1,s|=t>>a+o&1;for(a=0;a<=24;a+=8)s<<=1,s|=e>>a+o&1}for(a=0;a<=24;a+=8)s<<=1,s|=e>>a+o&1;r[i+0]=n>>>0,r[i+1]=s>>>0},t.r28shl=function(e,t){return e<>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,i,n){for(var s=0,o=0,a=r.length>>>1,u=0;u>>r[u]&1;for(u=a;u>>r[u]&1;i[n+0]=s>>>0,i[n+1]=o>>>0},t.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var s=23;s>=15;s-=4)i<<=6,i|=e>>>s&63;for(s=11;s>=3;s-=4)n|=e>>>s&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)]}return r>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r>>n[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var i=e.toString(2);i.length{var Buffer=r("../../node_modules/buffer/index.js").Buffer,i=r("../../node_modules/diffie-hellman/lib/generatePrime.js"),n=r("../../node_modules/diffie-hellman/lib/primes.json"),s=r("../../node_modules/diffie-hellman/lib/dh.js");var o={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(e){var t=new Buffer(n[e].prime,"hex"),r=new Buffer(n[e].gen,"hex");return new s(t,r)},t.createDiffieHellman=t.DiffieHellman=function e(t,r,n,a){return Buffer.isBuffer(r)||void 0===o[r]?e(t,"binary",r,n):(r=r||"binary",a=a||"binary",n=n||new Buffer([2]),Buffer.isBuffer(n)||(n=new Buffer(n,a)),"number"==typeof t?new s(i(t,n),n,!0):(Buffer.isBuffer(t)||(t=new Buffer(t,r)),new s(t,n,!0)))}},"../../node_modules/diffie-hellman/lib/dh.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer,i=r("../../node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js"),n=new(r("../../node_modules/miller-rabin/lib/mr.js")),s=new i(24),o=new i(11),a=new i(10),u=new i(3),h=new i(7),l=r("../../node_modules/diffie-hellman/lib/generatePrime.js"),d=r("../../node_modules/randombytes/browser.js");function c(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this._pub=new i(e),this}function f(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this._priv=new i(e),this}e.exports=m;var p={};function m(e,t,r){this.setGenerator(t),this.__prime=new i(e),this._prime=i.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=c,this.setPrivateKey=f):this._primeCode=8}function b(e,t){var r=new Buffer(e.toArray());return t?r.toString(t):r}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),i=[r,e.toString(16)].join("_");if(i in p)return p[i];var d,c=0;if(e.isEven()||!l.simpleSieve||!l.fermatTest(e)||!n.test(e))return c+=1,c+="02"===r||"05"===r?8:4,p[i]=c,c;switch(n.test(e.shrn(1))||(c+=2),r){case"02":e.mod(s).cmp(o)&&(c+=8);break;case"05":(d=e.mod(a)).cmp(u)&&d.cmp(h)&&(c+=8);break;default:c+=4}return p[i]=c,c}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new i(d(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(e){var t=(e=(e=new i(e)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new Buffer(t.toArray()),n=this.getPrime();if(r.length{var i=r("../../node_modules/randombytes/browser.js");e.exports=y,y.simpleSieve=b,y.fermatTest=g;var n=r("../../node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js"),s=new n(24),o=new(r("../../node_modules/miller-rabin/lib/mr.js")),a=new n(1),u=new n(2),h=new n(5),l=(new n(16),new n(8),new n(10)),d=new n(3),c=(new n(7),new n(11)),f=new n(4),p=(new n(12),null);function m(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var i=Math.ceil(Math.sqrt(r)),n=0;ne;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(h))for(;r.mod(l).cmp(d);)r.iadd(f)}else for(;r.mod(s).cmp(c);)r.iadd(f);if(b(p=r.shrn(1))&&b(r)&&g(p)&&g(r)&&o.test(p)&&o.test(r))return r}}},"../../node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js":function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var Buffer;"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{Buffer="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r("?7dc1").Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=a(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,u=o/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,t.length-1),f=Math.max(0,h-e.length+1);f<=c;f++){var p=h-f|0;l+=(o=(n=0|e.words[p])*(s=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o>>24-n&16777215)||o!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,u="le"===t,h=new e(s),l=this.clone();if(u){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),h[a]=o;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,f=0|o[1],p=8191&f,m=f>>>13,b=0|o[2],g=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,T=0|o[5],I=8191&T,O=T>>>13,A=0|o[6],j=8191&A,k=A>>>13,x=0|o[7],R=8191&x,P=x>>>13,N=0|o[8],C=8191&N,B=N>>>13,U=0|o[9],D=8191&U,L=U>>>13,q=0|a[0],F=8191&q,z=q>>>13,H=0|a[1],V=8191&H,G=H>>>13,W=0|a[2],K=8191&W,$=W>>>13,Z=0|a[3],Y=8191&Z,X=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,le=0|a[8],de=8191&le,ce=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,z))+Math.imul(c,F)|0))<<13)|0;h=((s=Math.imul(c,z))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,s=Math.imul(m,z);var ge=(h+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((s=s+Math.imul(c,G)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,s=Math.imul(y,z),i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,G)|0;var ye=(h+(i=i+Math.imul(d,K)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,K)|0))<<13)|0;h=((s=s+Math.imul(c,$)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(_,F)|0,s=Math.imul(_,z),i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,$)|0;var ve=(h+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,Y)|0))<<13)|0;h=((s=s+Math.imul(c,X)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(S,F)|0,s=Math.imul(S,z),i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(g,K)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,$)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,X)|0;var we=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(c,Q)|0))<<13)|0;h=((s=s+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(O,F)|0,s=Math.imul(O,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,$)|0,i=i+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((s=s+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(k,F)|0,s=Math.imul(k,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(O,V)|0,s=s+Math.imul(O,G)|0,i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,s=s+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(d,se)|0)|0)+((8191&(n=(n=n+Math.imul(d,oe)|0)+Math.imul(c,se)|0))<<13)|0;h=((s=s+Math.imul(c,oe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,z))+Math.imul(P,F)|0,s=Math.imul(P,z),i=i+Math.imul(j,V)|0,n=(n=n+Math.imul(j,G)|0)+Math.imul(k,V)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(O,K)|0,s=s+Math.imul(O,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0;var Ee=(h+(i=i+Math.imul(d,ue)|0)|0)+((8191&(n=(n=n+Math.imul(d,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((s=s+Math.imul(c,he)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,z))+Math.imul(B,F)|0,s=Math.imul(B,z),i=i+Math.imul(R,V)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,$)|0)+Math.imul(k,K)|0,s=s+Math.imul(k,$)|0,i=i+Math.imul(I,Y)|0,n=(n=n+Math.imul(I,X)|0)+Math.imul(O,Y)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(g,se)|0,n=(n=n+Math.imul(g,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,s=s+Math.imul(m,he)|0;var Se=(h+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ce)|0)+Math.imul(c,de)|0))<<13)|0;h=((s=s+Math.imul(c,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,z))+Math.imul(L,F)|0,s=Math.imul(L,z),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,G)|0,i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,K)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,X)|0)+Math.imul(k,Y)|0,s=s+Math.imul(k,X)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(w,se)|0,n=(n=n+Math.imul(w,oe)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(g,ue)|0,n=(n=n+Math.imul(g,he)|0)+Math.imul(y,ue)|0,s=s+Math.imul(y,he)|0,i=i+Math.imul(p,de)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,de)|0,s=s+Math.imul(m,ce)|0;var Te=(h+(i=i+Math.imul(d,pe)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((s=s+Math.imul(c,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,G))+Math.imul(L,V)|0,s=Math.imul(L,G),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,X)|0,i=i+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(O,re)|0,s=s+Math.imul(O,ie)|0,i=i+Math.imul(E,se)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,s=s+Math.imul(_,he)|0,i=i+Math.imul(g,de)|0,n=(n=n+Math.imul(g,ce)|0)+Math.imul(y,de)|0,s=s+Math.imul(y,ce)|0;var Ie=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((s=s+Math.imul(m,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,$))+Math.imul(L,K)|0,s=Math.imul(L,$),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(j,re)|0,n=(n=n+Math.imul(j,ie)|0)+Math.imul(k,re)|0,s=s+Math.imul(k,ie)|0,i=i+Math.imul(I,se)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(O,se)|0,s=s+Math.imul(O,oe)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(S,ue)|0,s=s+Math.imul(S,he)|0,i=i+Math.imul(w,de)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,de)|0,s=s+Math.imul(_,ce)|0;var Oe=(h+(i=i+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,me)|0)+Math.imul(y,pe)|0))<<13)|0;h=((s=s+Math.imul(y,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(L,Y)|0,s=Math.imul(L,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(j,se)|0,n=(n=n+Math.imul(j,oe)|0)+Math.imul(k,se)|0,s=s+Math.imul(k,oe)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(O,ue)|0,s=s+Math.imul(O,he)|0,i=i+Math.imul(E,de)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(S,de)|0,s=s+Math.imul(S,ce)|0;var Ae=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((s=s+Math.imul(_,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(L,Q)|0,s=Math.imul(L,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(B,re)|0,s=s+Math.imul(B,ie)|0,i=i+Math.imul(R,se)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(j,ue)|0,n=(n=n+Math.imul(j,he)|0)+Math.imul(k,ue)|0,s=s+Math.imul(k,he)|0,i=i+Math.imul(I,de)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(O,de)|0,s=s+Math.imul(O,ce)|0;var je=(h+(i=i+Math.imul(E,pe)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;h=((s=s+Math.imul(S,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(L,re)|0,s=Math.imul(L,ie),i=i+Math.imul(C,se)|0,n=(n=n+Math.imul(C,oe)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,oe)|0,i=i+Math.imul(R,ue)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(P,ue)|0,s=s+Math.imul(P,he)|0,i=i+Math.imul(j,de)|0,n=(n=n+Math.imul(j,ce)|0)+Math.imul(k,de)|0,s=s+Math.imul(k,ce)|0;var ke=(h+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((s=s+Math.imul(O,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,se),n=(n=Math.imul(D,oe))+Math.imul(L,se)|0,s=Math.imul(L,oe),i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(B,ue)|0,s=s+Math.imul(B,he)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,ce)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,ce)|0;var xe=(h+(i=i+Math.imul(j,pe)|0)|0)+((8191&(n=(n=n+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((s=s+Math.imul(k,me)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(D,ue),n=(n=Math.imul(D,he))+Math.imul(L,ue)|0,s=Math.imul(L,he),i=i+Math.imul(C,de)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,ce)|0;var Re=(h+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((s=s+Math.imul(P,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,de),n=(n=Math.imul(D,ce))+Math.imul(L,de)|0,s=Math.imul(L,ce);var Pe=(h+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((s=s+Math.imul(B,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(h+(i=Math.imul(D,pe))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(L,pe)|0))<<13)|0;return h=((s=Math.imul(L,me))+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=be,u[1]=ge,u[2]=ye,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Ee,u[8]=Se,u[9]=Te,u[10]=Ie,u[11]=Oe,u[12]=Ae,u[13]=je,u[14]=ke,u[15]=xe,u[16]=Re,u[17]=Pe,u[18]=Ne,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=c),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i>=1;return i},m.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=s>>>26,this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-s|d>>>s,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==t){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/o|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return b[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(e,n.addn(1).iushrn(1)),f=this.pow(e,n),p=o;0!==f.cmp(a);){for(var m=f,b=0;0!==m.cmp(a);b++)m=m.redSqr();i(b=0;i--){for(var h=t.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}u=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},n(E,M),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/elliptic/lib/elliptic.js":(e,t,r)=>{"use strict";var i=t;i.version=r("../../node_modules/elliptic/package.json").i8,i.utils=r("../../node_modules/elliptic/lib/elliptic/utils.js"),i.rand=r("../../node_modules/brorand/index.js"),i.curve=r("../../node_modules/elliptic/lib/elliptic/curve/index.js"),i.curves=r("../../node_modules/elliptic/lib/elliptic/curves.js"),i.ec=r("../../node_modules/elliptic/lib/elliptic/ec/index.js"),i.eddsa=r("../../node_modules/elliptic/lib/elliptic/eddsa/index.js")},"../../node_modules/elliptic/lib/elliptic/curve/base.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),n=r("../../node_modules/elliptic/lib/elliptic/utils.js"),s=n.getNAF,o=n.getJSF,a=n.assert;function u(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function h(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),i=s(t,1,this._bitLength),n=(1<=o;l--)u=(u<<1)+i[l];h.push(u)}for(var d=this.jpoint(null,null,null),c=this.jpoint(null,null,null),f=n;f>0;f--){for(o=0;o=0;h--){for(var l=0;h>=0&&0===o[h];h--)l++;if(h>=0&&l++,u=u.dblp(l),h<0)break;var d=o[h];a(0!==d),u="affine"===e.type?d>0?u.mixedAdd(n[d-1>>1]):u.mixedAdd(n[-d-1>>1].neg()):d>0?u.add(n[d-1>>1]):u.add(n[-d-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,i,n){var a,u,h,l=this._wnafT1,d=this._wnafT2,c=this._wnafT3,f=0;for(a=0;a=1;a-=2){var m=a-1,b=a;if(1===l[m]&&1===l[b]){var g=[t[m],null,null,t[b]];0===t[m].y.cmp(t[b].y)?(g[1]=t[m].add(t[b]),g[2]=t[m].toJ().mixedAdd(t[b].neg())):0===t[m].y.cmp(t[b].y.redNeg())?(g[1]=t[m].toJ().mixedAdd(t[b]),g[2]=t[m].add(t[b].neg())):(g[1]=t[m].toJ().mixedAdd(t[b]),g[2]=t[m].toJ().mixedAdd(t[b].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=o(r[m],r[b]);for(f=Math.max(v[0].length,f),c[m]=new Array(f),c[b]=new Array(f),u=0;u=0;a--){for(var S=0;a>=0;){var T=!0;for(u=0;u=0&&S++,M=M.dblp(S),a<0)break;for(u=0;u0?h=d[u][I-1>>1]:I<0&&(h=d[u][-I-1>>1].neg()),M="affine"===h.type?M.mixedAdd(h):M.add(h))}}for(a=0;a=Math.ceil((e.bitLength()+1)/t.step)},h.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n{"use strict";var i=r("../../node_modules/elliptic/lib/elliptic/utils.js"),n=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),s=r("../../node_modules/inherits/inherits_browser.js"),o=r("../../node_modules/elliptic/lib/elliptic/curve/base.js"),a=i.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new n(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function Point(e,t,r,i,s){o.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(t,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=s&&new n(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}s(u,o),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},u.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),s=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(t&&!u||!t&&u)&&(a=a.redNeg()),this.point(e,a)},u.prototype.pointFromY=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),s=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},s(Point,o.BasePoint),u.prototype.pointFromJSON=function(e){return Point.fromJSON(this,e)},u.prototype.point=function(e,t,r,i){return new Point(this,e,t,r,i)},Point.fromJSON=function(e,t){return new Point(e,t[0],t[1],t[2])},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Point.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),s=i.redAdd(t),o=s.redSub(r),a=i.redSub(t),u=n.redMul(o),h=s.redMul(a),l=n.redMul(a),d=o.redMul(s);return this.curve.point(u,h,d,l)},Point.prototype._projDbl=function(){var e,t,r,i,n,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var h=(i=this.curve._mulA(a)).redAdd(u);this.zOne?(e=o.redSub(a).redSub(u).redMul(h.redSub(this.curve.two)),t=h.redMul(i.redSub(u)),r=h.redSqr().redSub(h).redSub(h)):(n=this.z.redSqr(),s=h.redSub(n).redISub(n),e=o.redSub(a).redISub(u).redMul(s),t=h.redMul(i.redSub(u)),r=h.redMul(s))}else i=a.redAdd(u),n=this.curve._mulC(this.z).redSqr(),s=i.redSub(n).redSub(n),e=this.curve._mulC(o.redISub(i)).redMul(s),t=this.curve._mulC(i).redMul(a.redISub(u)),r=i.redMul(s);return this.curve.point(e,t,r)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),s=r.redSub(t),o=n.redSub(i),a=n.redAdd(i),u=r.redAdd(t),h=s.redMul(o),l=a.redMul(u),d=s.redMul(u),c=o.redMul(a);return this.curve.point(h,l,c,d)},Point.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),s=this.x.redMul(e.x),o=this.y.redMul(e.y),a=this.curve.d.redMul(s).redMul(o),u=n.redSub(a),h=n.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(o),d=i.redMul(u).redMul(l);return this.curve.twisted?(t=i.redMul(h).redMul(o.redSub(this.curve._mulA(s))),r=u.redMul(h)):(t=i.redMul(h).redMul(o.redSub(s)),r=this.curve._mulC(u).redMul(h)),this.curve.point(d,t,r)},Point.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},Point.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},Point.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},Point.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},Point.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},"../../node_modules/elliptic/lib/elliptic/curve/index.js":(e,t,r)=>{"use strict";var i=t;i.base=r("../../node_modules/elliptic/lib/elliptic/curve/base.js"),i.short=r("../../node_modules/elliptic/lib/elliptic/curve/short.js"),i.mont=r("../../node_modules/elliptic/lib/elliptic/curve/mont.js"),i.edwards=r("../../node_modules/elliptic/lib/elliptic/curve/edwards.js")},"../../node_modules/elliptic/lib/elliptic/curve/mont.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),n=r("../../node_modules/inherits/inherits_browser.js"),s=r("../../node_modules/elliptic/lib/elliptic/curve/base.js"),o=r("../../node_modules/elliptic/lib/elliptic/utils.js");function a(e){s.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(e,t,r){s.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,s),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},n(Point,s.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},a.prototype.point=function(e,t){return new Point(this,e,t)},a.prototype.pointFromJSON=function(e){return Point.fromJSON(this,e)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(e,t){return new Point(e,t[0],t[1]||e.one)},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),s=e.x.redSub(e.z).redMul(r),o=n.redMul(i),a=t.z.redMul(s.redAdd(o).redSqr()),u=t.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,u)},Point.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var s=n.length-1;s>=0;s--)0===n[s]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},"../../node_modules/elliptic/lib/elliptic/curve/short.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/elliptic/lib/elliptic/utils.js"),n=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),s=r("../../node_modules/inherits/inherits_browser.js"),o=r("../../node_modules/elliptic/lib/elliptic/curve/base.js"),a=i.assert;function u(e){o.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(e,t,r,i){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(u,o),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new n(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?r=s[0]:(r=s[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new n(e.a,16),b:new n(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),r=new n(2).toRed(t).redInvm(),i=r.redNeg(),s=new n(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(s).fromRed(),i.redSub(s).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,i,s,o,a,u,h,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=e,f=this.n.clone(),p=new n(1),m=new n(0),b=new n(0),g=new n(1),y=0;0!==c.cmpn(0);){var v=f.div(c);h=f.sub(v.mul(c)),l=b.sub(v.mul(p));var w=g.sub(v.mul(m));if(!i&&h.cmp(d)<0)t=u.neg(),r=p,i=h.neg(),s=l;else if(i&&2==++y)break;u=h,f=c,c=h,b=p,p=l,g=m,m=w}o=h.neg(),a=l;var _=i.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(_)>=0&&(o=t,a=r),i.negative&&(i=i.neg(),s=s.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:s},{a:o,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),u=n.mul(r.b),h=s.mul(i.b);return{k1:e.sub(o).sub(a),k2:u.add(h).neg()}},u.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s":""},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},Point.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(e){return e=new n(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Point.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},Point.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},Point.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Point.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(h,o.BasePoint),u.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),u=s.redSub(o);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),l=h.redMul(a),d=i.redMul(h),c=u.redSqr().redIAdd(l).redISub(d).redISub(d),f=u.redMul(d.redISub(c)).redISub(s.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(c,f,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,s=e.y.redMul(t).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),h=u.redMul(o),l=r.redMul(u),d=a.redSqr().redIAdd(h).redISub(l).redISub(l),c=a.redMul(l.redISub(d)).redISub(n.redMul(h)),f=this.z.redMul(o);return this.curve.jpoint(d,c,f)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},"../../node_modules/elliptic/lib/elliptic/curves.js":(e,t,r)=>{"use strict";var i,n=t,s=r("../../node_modules/hash.js/lib/hash.js"),o=r("../../node_modules/elliptic/lib/elliptic/curve/index.js"),a=r("../../node_modules/elliptic/lib/elliptic/utils.js").assert;function u(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=u,h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r("../../node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js")}catch(e){i=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},"../../node_modules/elliptic/lib/elliptic/ec/index.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),n=r("../../node_modules/hmac-drbg/lib/hmac-drbg.js"),s=r("../../node_modules/elliptic/lib/elliptic/utils.js"),o=r("../../node_modules/elliptic/lib/elliptic/curves.js"),a=r("../../node_modules/brorand/index.js"),u=s.assert,h=r("../../node_modules/elliptic/lib/elliptic/ec/key.js"),l=r("../../node_modules/elliptic/lib/elliptic/ec/signature.js");function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new h(this,e)},d.prototype.keyFromPrivate=function(e,t){return h.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return h.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new i(2));;){var o=new i(t.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},d.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,r,s){"object"==typeof r&&(s=r,r=null),s||(s={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),u=e.toArray("be",o),h=new n({hash:this.hash,entropy:a,nonce:u,pers:s.pers,persEnc:s.persEnc||"utf8"}),d=this.n.sub(new i(1)),c=0;;c++){var f=s.k?s.k(c):new i(h.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(d)>=0)){var p=this.g.mul(f);if(!p.isInfinity()){var m=p.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var g=f.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return s.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new l({r:b,s:g,recoveryParam:y})}}}}}},d.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n);var s=(t=new l(t,"hex")).r,o=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,u=o.invm(this.n),h=u.mul(e).umod(this.n),d=u.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(h,r.getPublic(),d)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(h,r.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},d.prototype.recoverPubKey=function(e,t,r,n){u((3&r)===r,"The recovery param is more than two bits"),t=new l(t,n);var s=this.n,o=new i(e),a=t.r,h=t.s,d=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),d):this.curve.pointFromX(a,d);var f=t.r.invm(s),p=s.sub(o).mul(f).umod(s),m=h.mul(f).umod(s);return this.g.mulAdd(p,a,m)},d.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new l(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(e,t,n)}catch(e){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},"../../node_modules/elliptic/lib/elliptic/ec/key.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),n=r("../../node_modules/elliptic/lib/elliptic/utils.js").assert;function s(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=s,s.fromPublic=function(e,t,r){return t instanceof s?t:new s(e,{pub:t,pubEnc:r})},s.fromPrivate=function(e,t,r){return t instanceof s?t:new s(e,{priv:t,privEnc:r})},s.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},s.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},s.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},s.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},s.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},s.prototype.inspect=function(){return""}},"../../node_modules/elliptic/lib/elliptic/ec/signature.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),n=r("../../node_modules/elliptic/lib/elliptic/utils.js"),s=n.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(s(e.r&&e.s,"Signature without r or s"),this.r=new i(e.r,16),this.s=new i(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=t.place;s>>=0;return!(n<=127)&&(t.place=o,n)}function h(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=o,o.prototype._importDER=function(e,t){e=n.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var s=u(e,r);if(!1===s)return!1;if(s+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;var h=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var l=u(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;var d=e.slice(r.place,l+r.place);if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new i(h),this.s=new i(d),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=h(t),r=h(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];l(i,t.length),(i=i.concat(t)).push(2),l(i,r.length);var s=i.concat(r),o=[48];return l(o,s.length),o=o.concat(s),n.encode(o,e)}},"../../node_modules/elliptic/lib/elliptic/eddsa/index.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/hash.js/lib/hash.js"),n=r("../../node_modules/elliptic/lib/elliptic/curves.js"),s=r("../../node_modules/elliptic/lib/elliptic/utils.js"),o=s.assert,a=s.parseBytes,u=r("../../node_modules/elliptic/lib/elliptic/eddsa/key.js"),h=r("../../node_modules/elliptic/lib/elliptic/eddsa/signature.js");function l(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}e.exports=l,l.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),s=this.encodePoint(n),o=this.hashInt(s,r.pubBytes(),e).mul(r.priv()),u=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:u,Rencoded:s})},l.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(s)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t{"use strict";var i=r("../../node_modules/elliptic/lib/elliptic/utils.js"),n=i.assert,s=i.parseBytes,o=i.cachedProperty;function a(e,t){this.eddsa=e,this._secret=s(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=s(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),o(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),e)},a.prototype.getPublic=function(e){return i.encode(this.pubBytes(),e)},e.exports=a},"../../node_modules/elliptic/lib/elliptic/eddsa/signature.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),n=r("../../node_modules/elliptic/lib/elliptic/utils.js"),s=n.assert,o=n.cachedProperty,a=n.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),s(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},"../../node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js":e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},"../../node_modules/elliptic/lib/elliptic/utils.js":(e,t,r)=>{"use strict";var i=t,n=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),s=r("../../node_modules/minimalistic-assert/index.js"),o=r("../../node_modules/minimalistic-crypto-utils/lib/utils.js");i.assert=s,i.toArray=o.toArray,i.zero2=o.zero2,i.toHex=o.toHex,i.encode=o.encode,i.getNAF=function(e,t,r){var i=new Array(Math.max(e.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-u:u,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},i.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,s=0;e.cmpn(-n)>0||t.cmpn(-s)>0;){var o,a,u=e.andln(3)+n&3,h=t.andln(3)+s&3;3===u&&(u=-1),3===h&&(h=-1),o=0==(1&u)?0:3!==(i=e.andln(7)+n&7)&&5!==i||2!==h?u:-u,r[0].push(o),a=0==(1&h)?0:3!==(i=t.andln(7)+s&7)&&5!==i||2!==u?h:-h,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),e.iushrn(1),t.iushrn(1)}return r},i.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new n(e,"hex","le")}},"../../node_modules/elliptic/node_modules/bn.js/lib/bn.js":function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var Buffer;"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{Buffer="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r("?f84f").Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=a(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,u=o/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,t.length-1),f=Math.max(0,h-e.length+1);f<=c;f++){var p=h-f|0;l+=(o=(n=0|e.words[p])*(s=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o>>24-n&16777215)||o!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,u="le"===t,h=new e(s),l=this.clone();if(u){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),h[a]=o;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,f=0|o[1],p=8191&f,m=f>>>13,b=0|o[2],g=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,T=0|o[5],I=8191&T,O=T>>>13,A=0|o[6],j=8191&A,k=A>>>13,x=0|o[7],R=8191&x,P=x>>>13,N=0|o[8],C=8191&N,B=N>>>13,U=0|o[9],D=8191&U,L=U>>>13,q=0|a[0],F=8191&q,z=q>>>13,H=0|a[1],V=8191&H,G=H>>>13,W=0|a[2],K=8191&W,$=W>>>13,Z=0|a[3],Y=8191&Z,X=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,le=0|a[8],de=8191&le,ce=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,z))+Math.imul(c,F)|0))<<13)|0;h=((s=Math.imul(c,z))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,s=Math.imul(m,z);var ge=(h+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((s=s+Math.imul(c,G)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,s=Math.imul(y,z),i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,G)|0;var ye=(h+(i=i+Math.imul(d,K)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,K)|0))<<13)|0;h=((s=s+Math.imul(c,$)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(_,F)|0,s=Math.imul(_,z),i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,$)|0;var ve=(h+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,Y)|0))<<13)|0;h=((s=s+Math.imul(c,X)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(S,F)|0,s=Math.imul(S,z),i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(g,K)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,$)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,X)|0;var we=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(c,Q)|0))<<13)|0;h=((s=s+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(O,F)|0,s=Math.imul(O,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,$)|0,i=i+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((s=s+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(k,F)|0,s=Math.imul(k,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(O,V)|0,s=s+Math.imul(O,G)|0,i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,s=s+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(d,se)|0)|0)+((8191&(n=(n=n+Math.imul(d,oe)|0)+Math.imul(c,se)|0))<<13)|0;h=((s=s+Math.imul(c,oe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,z))+Math.imul(P,F)|0,s=Math.imul(P,z),i=i+Math.imul(j,V)|0,n=(n=n+Math.imul(j,G)|0)+Math.imul(k,V)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(O,K)|0,s=s+Math.imul(O,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0;var Ee=(h+(i=i+Math.imul(d,ue)|0)|0)+((8191&(n=(n=n+Math.imul(d,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((s=s+Math.imul(c,he)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,z))+Math.imul(B,F)|0,s=Math.imul(B,z),i=i+Math.imul(R,V)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,$)|0)+Math.imul(k,K)|0,s=s+Math.imul(k,$)|0,i=i+Math.imul(I,Y)|0,n=(n=n+Math.imul(I,X)|0)+Math.imul(O,Y)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(g,se)|0,n=(n=n+Math.imul(g,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,s=s+Math.imul(m,he)|0;var Se=(h+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ce)|0)+Math.imul(c,de)|0))<<13)|0;h=((s=s+Math.imul(c,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,z))+Math.imul(L,F)|0,s=Math.imul(L,z),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,G)|0,i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,K)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,X)|0)+Math.imul(k,Y)|0,s=s+Math.imul(k,X)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(w,se)|0,n=(n=n+Math.imul(w,oe)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(g,ue)|0,n=(n=n+Math.imul(g,he)|0)+Math.imul(y,ue)|0,s=s+Math.imul(y,he)|0,i=i+Math.imul(p,de)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,de)|0,s=s+Math.imul(m,ce)|0;var Te=(h+(i=i+Math.imul(d,pe)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((s=s+Math.imul(c,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,G))+Math.imul(L,V)|0,s=Math.imul(L,G),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,X)|0,i=i+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(O,re)|0,s=s+Math.imul(O,ie)|0,i=i+Math.imul(E,se)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,s=s+Math.imul(_,he)|0,i=i+Math.imul(g,de)|0,n=(n=n+Math.imul(g,ce)|0)+Math.imul(y,de)|0,s=s+Math.imul(y,ce)|0;var Ie=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((s=s+Math.imul(m,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,$))+Math.imul(L,K)|0,s=Math.imul(L,$),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(j,re)|0,n=(n=n+Math.imul(j,ie)|0)+Math.imul(k,re)|0,s=s+Math.imul(k,ie)|0,i=i+Math.imul(I,se)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(O,se)|0,s=s+Math.imul(O,oe)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(S,ue)|0,s=s+Math.imul(S,he)|0,i=i+Math.imul(w,de)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,de)|0,s=s+Math.imul(_,ce)|0;var Oe=(h+(i=i+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,me)|0)+Math.imul(y,pe)|0))<<13)|0;h=((s=s+Math.imul(y,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(L,Y)|0,s=Math.imul(L,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(j,se)|0,n=(n=n+Math.imul(j,oe)|0)+Math.imul(k,se)|0,s=s+Math.imul(k,oe)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(O,ue)|0,s=s+Math.imul(O,he)|0,i=i+Math.imul(E,de)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(S,de)|0,s=s+Math.imul(S,ce)|0;var Ae=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((s=s+Math.imul(_,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(L,Q)|0,s=Math.imul(L,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(B,re)|0,s=s+Math.imul(B,ie)|0,i=i+Math.imul(R,se)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(j,ue)|0,n=(n=n+Math.imul(j,he)|0)+Math.imul(k,ue)|0,s=s+Math.imul(k,he)|0,i=i+Math.imul(I,de)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(O,de)|0,s=s+Math.imul(O,ce)|0;var je=(h+(i=i+Math.imul(E,pe)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;h=((s=s+Math.imul(S,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(L,re)|0,s=Math.imul(L,ie),i=i+Math.imul(C,se)|0,n=(n=n+Math.imul(C,oe)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,oe)|0,i=i+Math.imul(R,ue)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(P,ue)|0,s=s+Math.imul(P,he)|0,i=i+Math.imul(j,de)|0,n=(n=n+Math.imul(j,ce)|0)+Math.imul(k,de)|0,s=s+Math.imul(k,ce)|0;var ke=(h+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((s=s+Math.imul(O,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,se),n=(n=Math.imul(D,oe))+Math.imul(L,se)|0,s=Math.imul(L,oe),i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(B,ue)|0,s=s+Math.imul(B,he)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,ce)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,ce)|0;var xe=(h+(i=i+Math.imul(j,pe)|0)|0)+((8191&(n=(n=n+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((s=s+Math.imul(k,me)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(D,ue),n=(n=Math.imul(D,he))+Math.imul(L,ue)|0,s=Math.imul(L,he),i=i+Math.imul(C,de)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,ce)|0;var Re=(h+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((s=s+Math.imul(P,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,de),n=(n=Math.imul(D,ce))+Math.imul(L,de)|0,s=Math.imul(L,ce);var Pe=(h+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((s=s+Math.imul(B,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(h+(i=Math.imul(D,pe))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(L,pe)|0))<<13)|0;return h=((s=Math.imul(L,me))+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=be,u[1]=ge,u[2]=ye,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Ee,u[8]=Se,u[9]=Te,u[10]=Ie,u[11]=Oe,u[12]=Ae,u[13]=je,u[14]=ke,u[15]=xe,u[16]=Re,u[17]=Pe,u[18]=Ne,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=c),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i>=1;return i},m.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=s>>>26,this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-s|d>>>s,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==t){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/o|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return b[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(e,n.addn(1).iushrn(1)),f=this.pow(e,n),p=o;0!==f.cmp(a);){for(var m=f,b=0;0!==m.cmp(a);b++)m=m.redSqr();i(b=0;i--){for(var h=t.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}u=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},n(E,M),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/es6-promise/dist/es6-promise.js":function(e,t,r){var i=r("../../node_modules/process/browser.js"); +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.8+1e68dce6 + */e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=0,o=void 0,a=void 0,u=function(e,t){_[s]=e,_[s+1]=t,2===(s+=2)&&(a?a(M):S())};function h(e){a=e}function l(e){u=e}var d="undefined"!=typeof window?window:void 0,c=d||{},f=c.MutationObserver||c.WebKitMutationObserver,p="undefined"==typeof self&&"[object process]"==={}.toString.call(i),m="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function b(){return function(){return i.nextTick(M)}}function g(){return void 0!==o?function(){o(M)}:w()}function y(){var e=0,t=new f(M),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function v(){var e=new MessageChannel;return e.port1.onmessage=M,function(){return e.port2.postMessage(0)}}function w(){var e=setTimeout;return function(){return e(M,1)}}var _=new Array(1e3);function M(){for(var e=0;e{"use strict";var i,n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,s="object"==typeof Reflect?Reflect:null,o=s&&"function"==typeof s.apply?s.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};i=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,e.exports.once=function(e,t){return new n((function(r,i){function n(r){e.removeListener(t,s),i(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,r)}(e,n,{once:!0})}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var h=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function c(e,t,r,i){var n,events,s,o;if(l(r),void 0===(events=e._events)?(events=e._events=Object.create(null),e._eventsCount=0):(void 0!==events.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),events=e._events),s=events[t]),void 0===s)s=events[t]=r,++e._eventsCount;else if("function"==typeof s?s=events[t]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=d(e))>0&&s.length>n&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,o=a,console&&console.warn&&console.warn(o)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=f.bind(i);return n.listener=r,i.wrapFn=n,n}function m(e,t,r){var events=e._events;if(void 0===events)return[];var i=events[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(n=t[0]),n instanceof Error)throw n;var s=new Error("Unhandled error."+(n?" ("+n.message+")":""));throw s.context=n,s}var a=events[e];if(void 0===a)return!1;if("function"==typeof a)o(a,this,t);else{var u=a.length,h=g(a,u);for(r=0;r=0;n--)if(r[n]===t||r[n].listener===t){s=r[n].listener,i=n;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return m(this,e,!0)},u.prototype.rawListeners=function(e){return m(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):b.call(e,t)},u.prototype.listenerCount=b,u.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},"../../node_modules/evp_bytestokey/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/md5.js/index.js");e.exports=function(e,t,r,n){if(Buffer.isBuffer(e)||(e=Buffer.from(e,"binary")),t&&(Buffer.isBuffer(t)||(t=Buffer.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,o=Buffer.alloc(s),a=Buffer.alloc(n||0),u=Buffer.alloc(0);s>0||n>0;){var h=new i;h.update(u),h.update(e),t&&h.update(t),u=h.digest();var l=0;if(s>0){var d=o.length-s;l=Math.min(s,u.length),u.copy(o,d,0,l),s-=l}if(l0){var c=a.length-n,f=Math.min(n,u.length-l);u.copy(a,c,l,l+f),n-=f}}return u.fill(0),{key:o,iv:a}}},"../../node_modules/hash-base/index.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/readable-stream/readable-browser.js").Transform;function n(e){i.call(this),this._block=Buffer.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r("../../node_modules/inherits/inherits_browser.js")(n,i),n.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},n.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},n.prototype.update=function(e,t){if(function(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");Buffer.isBuffer(e)||(e=Buffer.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var n=this._blockOffset;n0;++s)this._length[s]+=o,(o=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*o);return this},n.prototype._update=function(){throw new Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},n.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=n},"../../node_modules/hash.js/lib/hash.js":(e,t,r)=>{var i=t;i.utils=r("../../node_modules/hash.js/lib/hash/utils.js"),i.common=r("../../node_modules/hash.js/lib/hash/common.js"),i.sha=r("../../node_modules/hash.js/lib/hash/sha.js"),i.ripemd=r("../../node_modules/hash.js/lib/hash/ripemd.js"),i.hmac=r("../../node_modules/hash.js/lib/hash/hmac.js"),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},"../../node_modules/hash.js/lib/hash/common.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/hash.js/lib/hash/utils.js"),n=r("../../node_modules/minimalistic-assert/index.js");function s(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=s,s.prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s{"use strict";var i=r("../../node_modules/hash.js/lib/hash/utils.js"),n=r("../../node_modules/minimalistic-assert/index.js");function s(e,t,r){if(!(this instanceof s))return new s(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}e.exports=s,s.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t{"use strict";var i=r("../../node_modules/hash.js/lib/hash/utils.js"),n=r("../../node_modules/hash.js/lib/hash/common.js"),s=i.rotl32,o=i.sum32,a=i.sum32_3,u=i.sum32_4,h=n.BlockHash;function l(){if(!(this instanceof l))return new l;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function c(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function f(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}i.inherits(l,h),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],h=this.h[3],l=this.h[4],y=r,v=i,w=n,_=h,M=l,E=0;E<80;E++){var S=o(s(u(r,d(E,i,n,h),e[p[E]+t],c(E)),b[E]),l);r=l,l=h,h=s(n,10),n=i,i=S,S=o(s(u(y,d(79-E,v,w,_),e[m[E]+t],f(E)),g[E]),M),y=M,M=_,_=s(w,10),w=v,v=S}S=a(this.h[1],n,_),this.h[1]=a(this.h[2],h,M),this.h[2]=a(this.h[3],l,y),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],i,w),this.h[0]=S},l.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},"../../node_modules/hash.js/lib/hash/sha.js":(e,t,r)=>{"use strict";t.sha1=r("../../node_modules/hash.js/lib/hash/sha/1.js"),t.sha224=r("../../node_modules/hash.js/lib/hash/sha/224.js"),t.sha256=r("../../node_modules/hash.js/lib/hash/sha/256.js"),t.sha384=r("../../node_modules/hash.js/lib/hash/sha/384.js"),t.sha512=r("../../node_modules/hash.js/lib/hash/sha/512.js")},"../../node_modules/hash.js/lib/hash/sha/1.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/hash.js/lib/hash/utils.js"),n=r("../../node_modules/hash.js/lib/hash/common.js"),s=r("../../node_modules/hash.js/lib/hash/sha/common.js"),o=i.rotl32,a=i.sum32,u=i.sum32_5,h=s.ft_1,l=n.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(c,l),e.exports=c,c.blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i{"use strict";var i=r("../../node_modules/hash.js/lib/hash/utils.js"),n=r("../../node_modules/hash.js/lib/hash/sha/256.js");function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(s,n),e.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},"../../node_modules/hash.js/lib/hash/sha/256.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/hash.js/lib/hash/utils.js"),n=r("../../node_modules/hash.js/lib/hash/common.js"),s=r("../../node_modules/hash.js/lib/hash/sha/common.js"),o=r("../../node_modules/minimalistic-assert/index.js"),a=i.sum32,u=i.sum32_4,h=i.sum32_5,l=s.ch32,d=s.maj32,c=s.s0_256,f=s.s1_256,p=s.g0_256,m=s.g1_256,b=n.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}i.inherits(y,b),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i{"use strict";var i=r("../../node_modules/hash.js/lib/hash/utils.js"),n=r("../../node_modules/hash.js/lib/hash/sha/512.js");function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(s,n),e.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},"../../node_modules/hash.js/lib/hash/sha/512.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/hash.js/lib/hash/utils.js"),n=r("../../node_modules/hash.js/lib/hash/common.js"),s=r("../../node_modules/minimalistic-assert/index.js"),o=i.rotr64_hi,a=i.rotr64_lo,u=i.shr64_hi,h=i.shr64_lo,l=i.sum64,d=i.sum64_hi,c=i.sum64_lo,f=i.sum64_4_hi,p=i.sum64_4_lo,m=i.sum64_5_hi,b=i.sum64_5_lo,g=n.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(e,t,r,i,n){var s=e&r^~e&n;return s<0&&(s+=4294967296),s}function _(e,t,r,i,n,s){var o=t&i^~t&s;return o<0&&(o+=4294967296),o}function M(e,t,r,i,n){var s=e&r^e&n^r&n;return s<0&&(s+=4294967296),s}function E(e,t,r,i,n,s){var o=t&i^t&s^i&s;return o<0&&(o+=4294967296),o}function S(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}function O(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function A(e,t){var r=o(e,t,1)^o(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function j(e,t){var r=a(e,t,1)^a(e,t,8)^h(e,t,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=o(e,t,19)^o(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function x(e,t){var r=a(e,t,19)^a(t,e,29)^h(e,t,6);return r<0&&(r+=4294967296),r}i.inherits(v,g),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i{"use strict";var i=r("../../node_modules/hash.js/lib/hash/utils.js").rotr32;function n(e,t,r){return e&t^~e&r}function s(e,t,r){return e&t^e&r^t&r}function o(e,t,r){return e^t^r}t.ft_1=function(e,t,r,i){return 0===e?n(t,r,i):1===e||3===e?o(t,r,i):2===e?s(t,r,i):void 0},t.ch32=n,t.maj32=s,t.p32=o,t.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},t.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},t.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},t.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},"../../node_modules/hash.js/lib/hash/utils.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/minimalistic-assert/index.js"),n=r("../../node_modules/inherits/inherits_browser.js");function s(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>6|192,r[i++]=63&o|128):s(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},t.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},t.sum64=function(e,t,r,i){var n=e[t],s=i+e[t+1]>>>0,o=(s>>0,e[t+1]=s},t.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},t.sum64_lo=function(e,t,r,i){return t+i>>>0},t.sum64_4_hi=function(e,t,r,i,n,s,o,a){var u=0,h=t;return u+=(h=h+i>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,i,n,s,o,a){return t+i+s+a>>>0},t.sum64_5_hi=function(e,t,r,i,n,s,o,a,u,h){var l=0,d=t;return l+=(d=d+i>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,i,n,s,o,a,u,h){return t+i+s+a+h>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},"../../node_modules/hmac-drbg/lib/hmac-drbg.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/hash.js/lib/hash.js"),n=r("../../node_modules/minimalistic-crypto-utils/lib/utils.js"),s=r("../../node_modules/minimalistic-assert/index.js");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),r=n.toArray(e.nonce,e.nonceEnc||"hex"),i=n.toArray(e.pers,e.persEnc||"hex");s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}e.exports=o,o.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var s=[];s.length{ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +t.read=function(e,t,r,i,n){var s,o,a=8*n-i-1,u=(1<>1,l=-7,d=r?n-1:0,c=r?-1:1,f=e[t+d];for(d+=c,s=f&(1<<-l)-1,f>>=-l,l+=a;l>0;s=256*s+e[t+d],d+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=i;l>0;o=256*o+e[t+d],d+=c,l-=8);if(0===s)s=1-h;else{if(s===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,i),s-=h}return(f?-1:1)*o*Math.pow(2,s-i)},t.write=function(e,t,r,i,n,s){var o,a,u,h=8*s-n-1,l=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:s-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+d>=1?c/u:c*Math.pow(2,1-d))*u>=2&&(o++,u/=2),o+d>=l?(a=0,o=l):o+d>=1?(a=(t*u-1)*Math.pow(2,n),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,n),o=0));n>=8;e[r+f]=255&a,f+=p,a/=256,n-=8);for(o=o<0;e[r+f]=255&o,f+=p,o/=256,h-=8);e[r+f-p]|=128*m}},"../../node_modules/inherits/inherits_browser.js":e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},"../../node_modules/int64-buffer/int64-buffer.js":function(e,t,r){var Buffer=r("../../node_modules/buffer/index.js").Buffer;!function(e){var t,r="undefined",i=r!==typeof Buffer&&Buffer,n=r!==typeof Uint8Array&&Uint8Array,s=r!==typeof ArrayBuffer&&ArrayBuffer,o=[0,0,0,0,0,0,0,0],a=Array.isArray||function(e){return!!e&&"[object Array]"==Object.prototype.toString.call(e)},u=4294967296;function h(a,h,w){var _=h?0:4,M=h?4:0,E=h?0:3,S=h?1:2,T=h?2:1,I=h?3:0,O=h?b:y,A=h?g:v,j=R.prototype,k="is"+a,x="_"+k;return j.buffer=void 0,j.offset=0,j[x]=!0,j.toNumber=P,j.toString=function(e){var t=this.buffer,r=this.offset,i=C(t,r+_),n=C(t,r+M),s="",o=!w&&2147483648&i;o&&(i=~i,n=u-n);e=e||10;for(;;){var a=i%e*u+n;if(i=Math.floor(i/e),n=Math.floor(a/e),s=(a%e).toString(e)+s,!i&&!n)break}o&&(s="-"+s);return s},j.toJSON=P,j.toArray=l,i&&(j.toBuffer=d),n&&(j.toArrayBuffer=c),R[k]=function(e){return!(!e||!e[x])},e[a]=R,R;function R(e,a,h,l){return this instanceof R?function(e,a,h,l,d){n&&s&&(a instanceof s&&(a=new n(a)),l instanceof s&&(l=new n(l)));if(!(a||h||l||t))return void(e.buffer=m(o,0));if(!f(a,h)){var c=t||Array;d=h,l=a,h=0,a=t===i?i.alloc(8):new c(8)}if(e.buffer=a,e.offset=h|=0,r===typeof l)return;"string"==typeof l?function(e,t,r,i){var n=0,s=r.length,o=0,a=0;"-"===r[0]&&n++;var h=n;for(;n=0))break;a=a*i+l,o=o*i+Math.floor(a/u),a%=u}h&&(o=~o,a?a=u-a:o++);N(e,t+_,o),N(e,t+M,a)}(a,h,l,d||10):f(l,d)?p(a,h,l,d):"number"==typeof d?(N(a,h+_,l),N(a,h+M,d)):l>0?O(a,h,l):l<0?A(a,h,l):p(a,h,o,0)}(this,e,a,h,l):new R(e,a,h,l)}function P(){var e=this.buffer,t=this.offset,r=C(e,t+_),i=C(e,t+M);return w||(r|=0),r?r*u+i:i}function N(e,t,r){e[t+I]=255&r,r>>=8,e[t+T]=255&r,r>>=8,e[t+S]=255&r,r>>=8,e[t+E]=255&r}function C(e,t){return 16777216*e[t+E]+(e[t+S]<<16)+(e[t+T]<<8)+e[t+I]}}function l(e){var r=this.buffer,i=this.offset;return t=null,!1!==e&&a(r)?8===r.length?r:r.slice(i,i+8):m(r,i)}function d(e){var r=this.buffer,n=this.offset;return t=i,!1!==e&&i.isBuffer(r)?8===r.length?r:r.slice(n,n+8):i.from(c.call(this,e))}function c(e){var r=this.buffer,i=this.offset,o=r.buffer;if(t=n,!1!==e&&!r.offset&&o instanceof s)return 8===o.byteLength?o:o.slice(i,i+8);var a=new n(8);return p(a,0,r,i),a.buffer}function f(e,t){var r=e&&e.length;return t|=0,r&&t+8<=r&&"string"!=typeof e[t]}function p(e,t,r,i){t|=0,i|=0;for(var n=0;n<8;n++)e[t++]=255&r[i++]}function m(e,t){return Array.prototype.slice.call(e,t,t+8)}function b(e,t,r){for(var i=t+8;i>t;)e[--i]=255&r,r/=256}function g(e,t,r){var i=t+8;for(r++;i>t;)e[--i]=255&-r^255,r/=256}function y(e,t,r){for(var i=t+8;t{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=i;var n={},s={};function o(e,t){var r,i,o;return t?(o=0<=(e>>>=0)&&e<256)&&(i=s[e])?i:(r=u(e,(0|e)<0?-1:0,!0),o&&(s[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(i=n[e])?i:(r=u(e,e<0?-1:0,!1),o&&(n[e]=r),r)}function a(e,t){if(isNaN(e))return t?g:b;if(t){if(e<0)return g;if(e>=f)return M}else{if(e<=-p)return E;if(e+1>=p)return _}return e<0?a(-e,t).neg():u(e%c|0,e/c|0,t)}function u(e,t,i){return new r(e,t,i)}r.fromInt=o,r.fromNumber=a,r.fromBits=u;var h=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return b;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===i)return l(e.substring(1),t,r).neg();for(var n=a(h(r,8)),s=b,o=0;o>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},S.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((s=u).isZero())return l+o;for(;l.length<6;)l="0"+l;o=""+l+o}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(e){return i(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},S.eq=S.equals,S.notEquals=function(e){return!this.eq(e)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(e){return this.comp(e)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(e){return this.comp(e)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(e){return this.comp(e)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(e){return this.comp(e)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(e){if(i(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(y)},S.neg=S.negate,S.add=function(e){i(e)||(e=d(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,s=65535&this.low,o=e.high>>>16,a=65535&e.high,h=e.low>>>16,l=0,c=0,f=0,p=0;return f+=(p+=s+(65535&e.low))>>>16,c+=(f+=n+h)>>>16,l+=(c+=r+a)>>>16,l+=t+o,u((f&=65535)<<16|(p&=65535),(l&=65535)<<16|(c&=65535),this.unsigned)},S.subtract=function(e){return i(e)||(e=d(e)),this.add(e.neg())},S.sub=S.subtract,S.multiply=function(e){if(this.isZero())return b;if(i(e)||(e=d(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return b;if(this.eq(E))return e.isOdd()?E:b;if(e.eq(E))return this.isOdd()?E:b;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,s=this.low>>>16,o=65535&this.low,h=e.high>>>16,l=65535&e.high,c=e.low>>>16,f=65535&e.low,p=0,g=0,y=0,v=0;return y+=(v+=o*f)>>>16,g+=(y+=s*f)>>>16,y&=65535,g+=(y+=o*c)>>>16,p+=(g+=n*f)>>>16,g&=65535,p+=(g+=s*c)>>>16,g&=65535,p+=(g+=o*l)>>>16,p+=r*f+n*c+s*l+o*h,u((y&=65535)<<16|(v&=65535),(p&=65535)<<16|(g&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(e){if(i(e)||(e=d(e)),e.isZero())throw Error("division by zero");var r,n,s;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:b;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return v;s=g}else{if(this.eq(E))return e.eq(y)||e.eq(w)?E:e.eq(E)?y:(r=this.shr(1).div(e).shl(1)).eq(b)?e.isNegative()?y:w:(n=this.sub(e.mul(r)),s=r.add(n.div(e)));if(e.eq(E))return this.unsigned?g:b;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=b}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),l=o<=48?1:h(2,o-48),c=a(r),f=c.mul(e);f.isNegative()||f.gt(n);)f=(c=a(r-=l,this.unsigned)).mul(e);c.isZero()&&(c=y),s=s.add(c),n=n.sub(f)}return s},S.div=S.divide,S.modulo=function(e){return i(e)||(e=d(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(e){return i(e)||(e=d(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},S.or=function(e){return i(e)||(e=d(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},S.xor=function(e){return i(e)||(e=d(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},S.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<>>32-e,this.unsigned):u(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},S.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,i){return i?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},"../../node_modules/md5.js/index.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/hash-base/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=new Array(16);function o(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function a(e,t){return e<>>32-t}function u(e,t,r,i,n,s,o){return a(e+(t&r|~t&i)+n+s|0,o)+t|0}function h(e,t,r,i,n,s,o){return a(e+(t&i|r&~i)+n+s|0,o)+t|0}function l(e,t,r,i,n,s,o){return a(e+(t^r^i)+n+s|0,o)+t|0}function d(e,t,r,i,n,s,o){return a(e+(r^(t|~i))+n+s|0,o)+t|0}i(o,n),o.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d;r=u(r,i,n,o,e[0],3614090360,7),o=u(o,r,i,n,e[1],3905402710,12),n=u(n,o,r,i,e[2],606105819,17),i=u(i,n,o,r,e[3],3250441966,22),r=u(r,i,n,o,e[4],4118548399,7),o=u(o,r,i,n,e[5],1200080426,12),n=u(n,o,r,i,e[6],2821735955,17),i=u(i,n,o,r,e[7],4249261313,22),r=u(r,i,n,o,e[8],1770035416,7),o=u(o,r,i,n,e[9],2336552879,12),n=u(n,o,r,i,e[10],4294925233,17),i=u(i,n,o,r,e[11],2304563134,22),r=u(r,i,n,o,e[12],1804603682,7),o=u(o,r,i,n,e[13],4254626195,12),n=u(n,o,r,i,e[14],2792965006,17),r=h(r,i=u(i,n,o,r,e[15],1236535329,22),n,o,e[1],4129170786,5),o=h(o,r,i,n,e[6],3225465664,9),n=h(n,o,r,i,e[11],643717713,14),i=h(i,n,o,r,e[0],3921069994,20),r=h(r,i,n,o,e[5],3593408605,5),o=h(o,r,i,n,e[10],38016083,9),n=h(n,o,r,i,e[15],3634488961,14),i=h(i,n,o,r,e[4],3889429448,20),r=h(r,i,n,o,e[9],568446438,5),o=h(o,r,i,n,e[14],3275163606,9),n=h(n,o,r,i,e[3],4107603335,14),i=h(i,n,o,r,e[8],1163531501,20),r=h(r,i,n,o,e[13],2850285829,5),o=h(o,r,i,n,e[2],4243563512,9),n=h(n,o,r,i,e[7],1735328473,14),r=l(r,i=h(i,n,o,r,e[12],2368359562,20),n,o,e[5],4294588738,4),o=l(o,r,i,n,e[8],2272392833,11),n=l(n,o,r,i,e[11],1839030562,16),i=l(i,n,o,r,e[14],4259657740,23),r=l(r,i,n,o,e[1],2763975236,4),o=l(o,r,i,n,e[4],1272893353,11),n=l(n,o,r,i,e[7],4139469664,16),i=l(i,n,o,r,e[10],3200236656,23),r=l(r,i,n,o,e[13],681279174,4),o=l(o,r,i,n,e[0],3936430074,11),n=l(n,o,r,i,e[3],3572445317,16),i=l(i,n,o,r,e[6],76029189,23),r=l(r,i,n,o,e[9],3654602809,4),o=l(o,r,i,n,e[12],3873151461,11),n=l(n,o,r,i,e[15],530742520,16),r=d(r,i=l(i,n,o,r,e[2],3299628645,23),n,o,e[0],4096336452,6),o=d(o,r,i,n,e[7],1126891415,10),n=d(n,o,r,i,e[14],2878612391,15),i=d(i,n,o,r,e[5],4237533241,21),r=d(r,i,n,o,e[12],1700485571,6),o=d(o,r,i,n,e[3],2399980690,10),n=d(n,o,r,i,e[10],4293915773,15),i=d(i,n,o,r,e[1],2240044497,21),r=d(r,i,n,o,e[8],1873313359,6),o=d(o,r,i,n,e[15],4264355552,10),n=d(n,o,r,i,e[6],2734768916,15),i=d(i,n,o,r,e[13],1309151649,21),r=d(r,i,n,o,e[4],4149444226,6),o=d(o,r,i,n,e[11],3174756917,10),n=d(n,o,r,i,e[2],718787259,15),i=d(i,n,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Buffer.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=o},"../../node_modules/miller-rabin/lib/mr.js":(e,t,r)=>{var i=r("../../node_modules/miller-rabin/node_modules/bn.js/lib/bn.js"),n=r("../../node_modules/brorand/index.js");function s(e){this.rand=e||new n.Rand}e.exports=s,s.create=function(e){return new s(e)},s.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var n=new i(this.rand.generate(r))}while(n.cmp(e)>=0);return n},s.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},s.prototype.test=function(e,t,r){var n=e.bitLength(),s=i.mont(e),o=new i(1).toRed(s);t||(t=Math.max(1,n/48|0));for(var a=e.subn(1),u=0;!a.testn(u);u++);for(var h=e.shrn(u),l=a.toRed(s);t>0;t--){var d=this._randrange(new i(2),a);r&&r(d);var c=d.toRed(s).redPow(h);if(0!==c.cmp(o)&&0!==c.cmp(l)){for(var f=1;f0;t--){var l=this._randrange(new i(2),o),d=e.gcd(l);if(0!==d.cmpn(1))return d;var c=l.toRed(n).redPow(u);if(0!==c.cmp(s)&&0!==c.cmp(h)){for(var f=1;f=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=a(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,u=o/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,t.length-1),f=Math.max(0,h-e.length+1);f<=c;f++){var p=h-f|0;l+=(o=(n=0|e.words[p])*(s=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o>>24-n&16777215)||o!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,u="le"===t,h=new e(s),l=this.clone();if(u){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),h[a]=o;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,f=0|o[1],p=8191&f,m=f>>>13,b=0|o[2],g=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,T=0|o[5],I=8191&T,O=T>>>13,A=0|o[6],j=8191&A,k=A>>>13,x=0|o[7],R=8191&x,P=x>>>13,N=0|o[8],C=8191&N,B=N>>>13,U=0|o[9],D=8191&U,L=U>>>13,q=0|a[0],F=8191&q,z=q>>>13,H=0|a[1],V=8191&H,G=H>>>13,W=0|a[2],K=8191&W,$=W>>>13,Z=0|a[3],Y=8191&Z,X=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,le=0|a[8],de=8191&le,ce=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,z))+Math.imul(c,F)|0))<<13)|0;h=((s=Math.imul(c,z))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,s=Math.imul(m,z);var ge=(h+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((s=s+Math.imul(c,G)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,s=Math.imul(y,z),i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,G)|0;var ye=(h+(i=i+Math.imul(d,K)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,K)|0))<<13)|0;h=((s=s+Math.imul(c,$)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(_,F)|0,s=Math.imul(_,z),i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,$)|0;var ve=(h+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,Y)|0))<<13)|0;h=((s=s+Math.imul(c,X)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(S,F)|0,s=Math.imul(S,z),i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(g,K)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,$)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,X)|0;var we=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(c,Q)|0))<<13)|0;h=((s=s+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(O,F)|0,s=Math.imul(O,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,$)|0,i=i+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((s=s+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(k,F)|0,s=Math.imul(k,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(O,V)|0,s=s+Math.imul(O,G)|0,i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,s=s+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(d,se)|0)|0)+((8191&(n=(n=n+Math.imul(d,oe)|0)+Math.imul(c,se)|0))<<13)|0;h=((s=s+Math.imul(c,oe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,z))+Math.imul(P,F)|0,s=Math.imul(P,z),i=i+Math.imul(j,V)|0,n=(n=n+Math.imul(j,G)|0)+Math.imul(k,V)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(O,K)|0,s=s+Math.imul(O,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0;var Ee=(h+(i=i+Math.imul(d,ue)|0)|0)+((8191&(n=(n=n+Math.imul(d,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((s=s+Math.imul(c,he)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,z))+Math.imul(B,F)|0,s=Math.imul(B,z),i=i+Math.imul(R,V)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,$)|0)+Math.imul(k,K)|0,s=s+Math.imul(k,$)|0,i=i+Math.imul(I,Y)|0,n=(n=n+Math.imul(I,X)|0)+Math.imul(O,Y)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(g,se)|0,n=(n=n+Math.imul(g,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,s=s+Math.imul(m,he)|0;var Se=(h+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ce)|0)+Math.imul(c,de)|0))<<13)|0;h=((s=s+Math.imul(c,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,z))+Math.imul(L,F)|0,s=Math.imul(L,z),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,G)|0,i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,K)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,X)|0)+Math.imul(k,Y)|0,s=s+Math.imul(k,X)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(w,se)|0,n=(n=n+Math.imul(w,oe)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(g,ue)|0,n=(n=n+Math.imul(g,he)|0)+Math.imul(y,ue)|0,s=s+Math.imul(y,he)|0,i=i+Math.imul(p,de)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,de)|0,s=s+Math.imul(m,ce)|0;var Te=(h+(i=i+Math.imul(d,pe)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((s=s+Math.imul(c,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,G))+Math.imul(L,V)|0,s=Math.imul(L,G),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,X)|0,i=i+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(O,re)|0,s=s+Math.imul(O,ie)|0,i=i+Math.imul(E,se)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,s=s+Math.imul(_,he)|0,i=i+Math.imul(g,de)|0,n=(n=n+Math.imul(g,ce)|0)+Math.imul(y,de)|0,s=s+Math.imul(y,ce)|0;var Ie=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((s=s+Math.imul(m,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,$))+Math.imul(L,K)|0,s=Math.imul(L,$),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(j,re)|0,n=(n=n+Math.imul(j,ie)|0)+Math.imul(k,re)|0,s=s+Math.imul(k,ie)|0,i=i+Math.imul(I,se)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(O,se)|0,s=s+Math.imul(O,oe)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(S,ue)|0,s=s+Math.imul(S,he)|0,i=i+Math.imul(w,de)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,de)|0,s=s+Math.imul(_,ce)|0;var Oe=(h+(i=i+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,me)|0)+Math.imul(y,pe)|0))<<13)|0;h=((s=s+Math.imul(y,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(L,Y)|0,s=Math.imul(L,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(j,se)|0,n=(n=n+Math.imul(j,oe)|0)+Math.imul(k,se)|0,s=s+Math.imul(k,oe)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(O,ue)|0,s=s+Math.imul(O,he)|0,i=i+Math.imul(E,de)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(S,de)|0,s=s+Math.imul(S,ce)|0;var Ae=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((s=s+Math.imul(_,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(L,Q)|0,s=Math.imul(L,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(B,re)|0,s=s+Math.imul(B,ie)|0,i=i+Math.imul(R,se)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(j,ue)|0,n=(n=n+Math.imul(j,he)|0)+Math.imul(k,ue)|0,s=s+Math.imul(k,he)|0,i=i+Math.imul(I,de)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(O,de)|0,s=s+Math.imul(O,ce)|0;var je=(h+(i=i+Math.imul(E,pe)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;h=((s=s+Math.imul(S,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(L,re)|0,s=Math.imul(L,ie),i=i+Math.imul(C,se)|0,n=(n=n+Math.imul(C,oe)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,oe)|0,i=i+Math.imul(R,ue)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(P,ue)|0,s=s+Math.imul(P,he)|0,i=i+Math.imul(j,de)|0,n=(n=n+Math.imul(j,ce)|0)+Math.imul(k,de)|0,s=s+Math.imul(k,ce)|0;var ke=(h+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((s=s+Math.imul(O,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,se),n=(n=Math.imul(D,oe))+Math.imul(L,se)|0,s=Math.imul(L,oe),i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(B,ue)|0,s=s+Math.imul(B,he)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,ce)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,ce)|0;var xe=(h+(i=i+Math.imul(j,pe)|0)|0)+((8191&(n=(n=n+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((s=s+Math.imul(k,me)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(D,ue),n=(n=Math.imul(D,he))+Math.imul(L,ue)|0,s=Math.imul(L,he),i=i+Math.imul(C,de)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,ce)|0;var Re=(h+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((s=s+Math.imul(P,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,de),n=(n=Math.imul(D,ce))+Math.imul(L,de)|0,s=Math.imul(L,ce);var Pe=(h+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((s=s+Math.imul(B,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(h+(i=Math.imul(D,pe))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(L,pe)|0))<<13)|0;return h=((s=Math.imul(L,me))+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=be,u[1]=ge,u[2]=ye,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Ee,u[8]=Se,u[9]=Te,u[10]=Ie,u[11]=Oe,u[12]=Ae,u[13]=je,u[14]=ke,u[15]=xe,u[16]=Re,u[17]=Pe,u[18]=Ne,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=c),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i>=1;return i},m.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=s>>>26,this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-s|d>>>s,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==t){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/o|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return b[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(e,n.addn(1).iushrn(1)),f=this.pow(e,n),p=o;0!==f.cmp(a);){for(var m=f,b=0;0!==m.cmp(a);b++)m=m.redSqr();i(b=0;i--){for(var h=t.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}u=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},n(E,M),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/minimalistic-assert/index.js":e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},"../../node_modules/minimalistic-crypto-utils/lib/utils.js":(e,t)=>{"use strict";var r=t;function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}},"../../node_modules/parse-asn1/asn1.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/asn1.js/lib/asn1.js");t.certificate=r("../../node_modules/parse-asn1/certificate.js");var n=i.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));t.RSAPrivateKey=n;var s=i.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=s;var o=i.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));t.PublicKey=o;var a=i.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=i.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=u;var h=i.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));t.EncryptedPrivateKey=h;var l=i.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));t.DSAPrivateKey=l,t.DSAparam=i.define("DSAparam",(function(){this.int()}));var d=i.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(c),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=d;var c=i.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=i.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},"../../node_modules/parse-asn1/certificate.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/asn1.js/lib/asn1.js"),n=i.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),s=i.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),o=i.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=i.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())})),u=i.define("RelativeDistinguishedName",(function(){this.setof(s)})),h=i.define("RDNSequence",(function(){this.seqof(u)})),l=i.define("Name",(function(){this.choice({rdnSequence:this.use(h)})})),d=i.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))})),c=i.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),f=i.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(l),this.key("validity").use(d),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(c).optional())})),p=i.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(f),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())}));e.exports=p},"../../node_modules/parse-asn1/fixProc.js":(e,t,r)=>{var i=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,s=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,o=r("../../node_modules/evp_bytestokey/index.js"),a=r("../../node_modules/browserify-aes/browser.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e,t){var r,u=e.toString(),h=u.match(i);if(h){var l="aes"+h[1],d=Buffer.from(h[2],"hex"),c=Buffer.from(h[3].replace(/[\r\n]/g,""),"base64"),f=o(t,d.slice(0,8),parseInt(h[1],10)).key,p=[],m=a.createDecipheriv(l,f,d);p.push(m.update(c)),p.push(m.final()),r=Buffer.concat(p)}else{var b=u.match(s);r=Buffer.from(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(n)[1],data:r}}},"../../node_modules/parse-asn1/index.js":(e,t,r)=>{var i=r("../../node_modules/parse-asn1/asn1.js"),n=r("../../node_modules/parse-asn1/aesid.json"),s=r("../../node_modules/parse-asn1/fixProc.js"),o=r("../../node_modules/browserify-aes/browser.js"),a=r("../../node_modules/pbkdf2/browser.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function u(e){var t;"object"!=typeof e||Buffer.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=Buffer.from(e));var r,u,h=s(e,t),l=h.tag,d=h.data;switch(l){case"CERTIFICATE":u=i.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=i.PublicKey.decode(d,"der")),r=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=i.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":d=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),s=n[e.algorithm.decrypt.cipher.algo.join(".")],u=e.algorithm.decrypt.cipher.iv,h=e.subjectPrivateKey,l=parseInt(s.split("-")[1],10)/8,d=a.pbkdf2Sync(t,r,i,l,"sha1"),c=o.createDecipheriv(s,d,u),f=[];return f.push(c.update(h)),f.push(c.final()),Buffer.concat(f)}(d=i.EncryptedPrivateKey.decode(d,"der"),t);case"PRIVATE KEY":switch(r=(u=i.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:i.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=i.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=i.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+l)}}e.exports=u,u.signature=i.signature},"../../node_modules/pbkdf2/browser.js":(e,t,r)=>{t.pbkdf2=r("../../node_modules/pbkdf2/lib/async.js"),t.pbkdf2Sync=r("../../node_modules/pbkdf2/lib/sync-browser.js")},"../../node_modules/pbkdf2/lib/async.js":(e,t,r)=>{var i,n,s=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=r("../../node_modules/pbkdf2/lib/precondition.js"),a=r("../../node_modules/pbkdf2/lib/default-encoding.js"),u=r("../../node_modules/pbkdf2/lib/sync-browser.js"),h=r("../../node_modules/pbkdf2/lib/to-buffer.js"),l=r.g.crypto&&r.g.crypto.subtle,d={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},c=[];function f(){return n||(n=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function p(e,t,r,i,n){return l.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return l.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:n}},e,i<<3)})).then((function(e){return Buffer.from(e)}))}e.exports=function(e,t,n,m,b,g){"function"==typeof b&&(g=b,b=void 0);var y=d[(b=b||"sha1").toLowerCase()];if(y&&"function"==typeof r.g.Promise){if(o(n,m),e=h(e,a,"Password"),t=h(t,a,"Salt"),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){f()((function(){t(null,e)}))}),(function(e){f()((function(){t(e)}))}))}(function(e){if(r.g.process&&!r.g.process.browser)return s.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return s.resolve(!1);if(void 0!==c[e])return c[e];var t=p(i=i||Buffer.alloc(8),i,10,128,e).then((function(){return!0})).catch((function(){return!1}));return c[e]=t,t}(y).then((function(r){return r?p(e,t,n,m,y):u(e,t,n,m,b)})),g)}else f()((function(){var r;try{r=u(e,t,n,m,b)}catch(e){return g(e)}g(null,r)}))}},"../../node_modules/pbkdf2/lib/default-encoding.js":(e,t,r)=>{var i,n=r("../../node_modules/process/browser.js");if(r.g.process&&r.g.process.browser)i="utf-8";else if(r.g.process&&r.g.process.version){i=parseInt(n.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else i="utf-8";e.exports=i},"../../node_modules/pbkdf2/lib/precondition.js":e=>{var t=Math.pow(2,30)-1;e.exports=function(e,r){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>t||r!=r)throw new TypeError("Bad key length")}},"../../node_modules/pbkdf2/lib/sync-browser.js":(e,t,r)=>{var i=r("../../node_modules/create-hash/md5.js"),n=r("../../node_modules/ripemd160/index.js"),s=r("../../node_modules/sha.js/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=r("../../node_modules/pbkdf2/lib/precondition.js"),a=r("../../node_modules/pbkdf2/lib/default-encoding.js"),u=r("../../node_modules/pbkdf2/lib/to-buffer.js"),h=Buffer.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(e,t,r){var o=function(e){function t(t){return s(e).update(t).digest()}function r(e){return(new n).update(e).digest()}return"rmd160"===e||"ripemd160"===e?r:"md5"===e?i:t}(e),a="sha512"===e||"sha384"===e?128:64;t.length>a?t=o(t):t.length{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e,t,r){if(Buffer.isBuffer(e))return e;if("string"==typeof e)return Buffer.from(e,t);if(ArrayBuffer.isView(e))return Buffer.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},"../../node_modules/process/browser.js":e=>{var t,r,i=e.exports={};function n(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===n||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:n}catch(e){t=n}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var a,u=[],h=!1,l=-1;function d(){h&&a&&(h=!1,a.length?u=a.concat(u):l=-1,u.length&&c())}function c(){if(!h){var e=o(d);h=!0;for(var t=u.length;t;){for(a=u,u=[];++l1)for(var r=1;r{"use strict";e.exports=r("../../node_modules/protobufjs/src/index-light.js")},"../../node_modules/protobufjs/src/converter.js":(e,t,r)=>{"use strict";var i=t,n=r("../../node_modules/protobufjs/src/enum.js"),s=r("../../node_modules/protobufjs/src/util.js");function o(e,t,r,i){var s=!1;if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(d%s){",i);for(var o=t.resolvedType.values,a=Object.keys(o),u=0;u>>0",i,i);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",i,i);break;case"uint64":h=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,h)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,h?"true":"");break;case"bytes":e('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length >= 0)",i)("m%s=d%s",i,i);break;case"string":e("m%s=String(d%s)",i,i);break;case"bool":e("m%s=Boolean(d%s)",i,i)}}return e}function a(e,t,r,i){if(t.resolvedType)t.resolvedType instanceof n?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",i,r,i,i,r,i,i):e("d%s=types[%i].toObject(m%s,o)",i,r,i);else{var s=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,s?"true":"",i);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:e("d%s=m%s",i,i)}}return e}i.fromObject=function(e){var t=e.fieldsArray,r=s.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var i=0;i{"use strict";e.exports=function(e){var t=s.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos>>3){");for(var r=0;r>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===n.basic[u]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",u),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==n.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',h):t("%s[k]=value",h)):a.repeated?(t("if(!(%s&&%s.length))",h,h)("%s=[]",h),void 0!==n.packed[u]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos{"use strict";e.exports=function(e){for(var t,r=s.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(s.compareFieldsById),u=0;u>>0,8|n.mapKey[h.keyType],h.keyType),void 0===c?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,d,t),r("}")("}")):h.repeated?(r("if(%s!=null&&%s.length){",t,t),h.packed&&void 0!==n.packed[d]?r("w.uint32(%i).fork()",(h.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",d,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===c?o(r,h,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(h.id<<3|c)>>>0,d,t)),r("}")):(h.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,h.name),void 0===c?o(r,h,l,t):r("w.uint32(%i).%s(%s)",(h.id<<3|c)>>>0,d,t))}return r("return w")};var i=r("../../node_modules/protobufjs/src/enum.js"),n=r("../../node_modules/protobufjs/src/types.js"),s=r("../../node_modules/protobufjs/src/util.js");function o(e,t,r,i){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,i,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,i,(t.id<<3|2)>>>0)}},"../../node_modules/protobufjs/src/enum.js":(e,t,r)=>{"use strict";e.exports=o;var i=r("../../node_modules/protobufjs/src/object.js");((o.prototype=Object.create(i.prototype)).constructor=o).className="Enum";var n=r("../../node_modules/protobufjs/src/namespace.js"),s=r("../../node_modules/protobufjs/src/util.js");function o(e,t,r,n,s,o){if(i.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=s||{},this.valuesOptions=o,this.reserved=void 0,t)for(var a=Object.keys(t),u=0;u{"use strict";e.exports=h;var i=r("../../node_modules/protobufjs/src/object.js");((h.prototype=Object.create(i.prototype)).constructor=h).className="Field";var n,s=r("../../node_modules/protobufjs/src/enum.js"),o=r("../../node_modules/protobufjs/src/types.js"),a=r("../../node_modules/protobufjs/src/util.js"),u=/^required|optional|repeated$/;function h(e,t,r,n,s,h,l){if(a.isObject(n)?(l=s,h=n,n=s=void 0):a.isObject(s)&&(l=h,h=s,s=void 0),i.call(this,e,h),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==n&&!u.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==s&&!a.isString(s))throw TypeError("extend must be a string");"proto3_optional"===n&&(n="optional"),this.rule=n&&"optional"!==n?n:void 0,this.type=r,this.id=t,this.extend=s||void 0,this.required="required"===n,this.optional=!this.required,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==o.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=l}h.fromJSON=function(e,t){return new h(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(h.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),h.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),i.prototype.setOption.call(this,e,t,r)},h.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},h.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=o.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof n?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof s&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof s)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof n&&(this.parent.ctor.prototype[this.name]=this.defaultValue),i.prototype.resolve.call(this)},h.d=function(e,t,r,i){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(n,s){a.decorateType(n.constructor).add(new h(s,e,t,r,{default:i}))}},h._configure=function(e){n=e}},"../../node_modules/protobufjs/src/index-light.js":(e,t,r)=>{"use strict";var i=e.exports=r("../../node_modules/protobufjs/src/index-minimal.js");i.build="light",i.load=function(e,t,r){return"function"==typeof t?(r=t,t=new i.Root):t||(t=new i.Root),t.load(e,r)},i.loadSync=function(e,t){return t||(t=new i.Root),t.loadSync(e)},i.encoder=r("../../node_modules/protobufjs/src/encoder.js"),i.decoder=r("../../node_modules/protobufjs/src/decoder.js"),i.verifier=r("../../node_modules/protobufjs/src/verifier.js"),i.converter=r("../../node_modules/protobufjs/src/converter.js"),i.ReflectionObject=r("../../node_modules/protobufjs/src/object.js"),i.Namespace=r("../../node_modules/protobufjs/src/namespace.js"),i.Root=r("../../node_modules/protobufjs/src/root.js"),i.Enum=r("../../node_modules/protobufjs/src/enum.js"),i.Type=r("../../node_modules/protobufjs/src/type.js"),i.Field=r("../../node_modules/protobufjs/src/field.js"),i.OneOf=r("../../node_modules/protobufjs/src/oneof.js"),i.MapField=r("../../node_modules/protobufjs/src/mapfield.js"),i.Service=r("../../node_modules/protobufjs/src/service.js"),i.Method=r("../../node_modules/protobufjs/src/method.js"),i.Message=r("../../node_modules/protobufjs/src/message.js"),i.wrappers=r("../../node_modules/protobufjs/src/wrappers.js"),i.types=r("../../node_modules/protobufjs/src/types.js"),i.util=r("../../node_modules/protobufjs/src/util.js"),i.ReflectionObject._configure(i.Root),i.Namespace._configure(i.Type,i.Service,i.Enum),i.Root._configure(i.Type),i.Field._configure(i.Type)},"../../node_modules/protobufjs/src/index-minimal.js":(e,t,r)=>{"use strict";var i=t;function n(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}i.build="minimal",i.Writer=r("../../node_modules/protobufjs/src/writer.js"),i.BufferWriter=r("../../node_modules/protobufjs/src/writer_buffer.js"),i.Reader=r("../../node_modules/protobufjs/src/reader.js"),i.BufferReader=r("../../node_modules/protobufjs/src/reader_buffer.js"),i.util=r("../../node_modules/protobufjs/src/util/minimal.js"),i.rpc=r("../../node_modules/protobufjs/src/rpc.js"),i.roots=r("../../node_modules/protobufjs/src/roots.js"),i.configure=n,n()},"../../node_modules/protobufjs/src/mapfield.js":(e,t,r)=>{"use strict";e.exports=o;var i=r("../../node_modules/protobufjs/src/field.js");((o.prototype=Object.create(i.prototype)).constructor=o).className="MapField";var n=r("../../node_modules/protobufjs/src/types.js"),s=r("../../node_modules/protobufjs/src/util.js");function o(e,t,r,n,o,a){if(i.call(this,e,t,n,void 0,void 0,o,a),!s.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(e,t){return new o(e,t.id,t.keyType,t.type,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===n.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return i.prototype.resolve.call(this)},o.d=function(e,t,r){return"function"==typeof r?r=s.decorateType(r).name:r&&"object"==typeof r&&(r=s.decorateEnum(r).name),function(i,n){s.decorateType(i.constructor).add(new o(n,e,t,r))}}},"../../node_modules/protobufjs/src/message.js":(e,t,r)=>{"use strict";e.exports=n;var i=r("../../node_modules/protobufjs/src/util/minimal.js");function n(e){if(e)for(var t=Object.keys(e),r=0;r{"use strict";e.exports=s;var i=r("../../node_modules/protobufjs/src/object.js");((s.prototype=Object.create(i.prototype)).constructor=s).className="Method";var n=r("../../node_modules/protobufjs/src/util.js");function s(e,t,r,s,o,a,u,h,l){if(n.isObject(o)?(u=o,o=a=void 0):n.isObject(a)&&(u=a,a=void 0),void 0!==t&&!n.isString(t))throw TypeError("type must be a string");if(!n.isString(r))throw TypeError("requestType must be a string");if(!n.isString(s))throw TypeError("responseType must be a string");i.call(this,e,u),this.type=t||"rpc",this.requestType=r,this.requestStream=!!o||void 0,this.responseType=s,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=h,this.parsedOptions=l}s.fromJSON=function(e,t){return new s(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},s.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),i.prototype.resolve.call(this))}},"../../node_modules/protobufjs/src/namespace.js":(e,t,r)=>{"use strict";e.exports=d;var i=r("../../node_modules/protobufjs/src/object.js");((d.prototype=Object.create(i.prototype)).constructor=d).className="Namespace";var n,s,o,a=r("../../node_modules/protobufjs/src/field.js"),u=r("../../node_modules/protobufjs/src/util.js"),h=r("../../node_modules/protobufjs/src/oneof.js");function l(e,t){if(e&&e.length){for(var r={},i=0;it)return!0;return!1},d.isReservedName=function(e,t){if(e)for(var r=0;r0;){var i=e.shift();if(r.nested&&r.nested[i]){if(!((r=r.nested[i])instanceof d))throw Error("path conflicts with non-namespace objects")}else r.add(r=new d(i))}return t&&r.addJSON(t),r},d.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t-1)return i}else if(i instanceof d&&(i=i.lookup(e.slice(1),t,!0)))return i}else for(var n=0;n{"use strict";e.exports=s,s.className="ReflectionObject";var i,n=r("../../node_modules/protobufjs/src/util.js");function s(e,t){if(!n.isString(e))throw TypeError("name must be a string");if(t&&!n.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(s.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),s.prototype.toJSON=function(){throw Error()},s.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof i&&t._handleAdd(this)},s.prototype.onRemove=function(e){var t=e.root;t instanceof i&&t._handleRemove(this),this.parent=null,this.resolved=!1},s.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},s.prototype.getOption=function(e){if(this.options)return this.options[e]},s.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},s.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(r){var s=i.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(s){var o=s[e];n.setProperty(o,r,t)}else(s={})[e]=n.setProperty({},r,t),i.push(s)}else{var a={};a[e]=t,i.push(a)}return this},s.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),i=0;i{"use strict";e.exports=o;var i=r("../../node_modules/protobufjs/src/object.js");((o.prototype=Object.create(i.prototype)).constructor=o).className="OneOf";var n=r("../../node_modules/protobufjs/src/field.js"),s=r("../../node_modules/protobufjs/src/util.js");function o(e,t,r,n){if(Array.isArray(t)||(r=t,t=void 0),i.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=n}function a(e){if(e.parent)for(var t=0;t-1&&this.oneof.splice(t,1),e.partOf=null,this},o.prototype.onAdd=function(e){i.prototype.onAdd.call(this,e);for(var t=0;t{"use strict";e.exports=u;var i,n=r("../../node_modules/protobufjs/src/util/minimal.js"),s=n.LongBits,o=n.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var h,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},d=function(){return n.Buffer?function(e){return(u.create=function(e){return n.Buffer.isBuffer(e)?new i(e):l(e)})(e)}:l};function c(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new s(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}u.create=d(),u.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,u.prototype.uint32=(h=4294967295,function(){if(h=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return h;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return h}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return f(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){i=e,u.create=d(),i._configure();var t=n.Long?"toLong":"toNumber";n.merge(u.prototype,{int64:function(){return c.call(this)[t](!1)},uint64:function(){return c.call(this)[t](!0)},sint64:function(){return c.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},"../../node_modules/protobufjs/src/reader_buffer.js":(e,t,r)=>{"use strict";e.exports=s;var i=r("../../node_modules/protobufjs/src/reader.js");(s.prototype=Object.create(i.prototype)).constructor=s;var n=r("../../node_modules/protobufjs/src/util/minimal.js");function s(e){i.call(this,e)}s._configure=function(){n.Buffer&&(s.prototype._slice=n.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},"../../node_modules/protobufjs/src/root.js":(e,t,r)=>{"use strict";e.exports=d;var i=r("../../node_modules/protobufjs/src/namespace.js");((d.prototype=Object.create(i.prototype)).constructor=d).className="Root";var n,s,o,a=r("../../node_modules/protobufjs/src/field.js"),u=r("../../node_modules/protobufjs/src/enum.js"),h=r("../../node_modules/protobufjs/src/oneof.js"),l=r("../../node_modules/protobufjs/src/util.js");function d(e){i.call(this,"",e),this.deferred=[],this.files=[]}function c(){}d.fromJSON=function(e,t){return t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=l.path.resolve,d.prototype.fetch=l.fetch,d.prototype.load=function e(t,r,i){"function"==typeof r&&(i=r,r=void 0);var n=this;if(!i)return l.asPromise(e,n,t,r);var a=i===c;function u(e,t){if(i){var r=i;if(i=null,a)throw e;r(e,t)}}function h(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in o)return r}return null}function d(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){s.filename=e;var i,o=s(t,n,r),d=0;if(o.imports)for(;d-1))if(n.files.push(e),e in o)a?d(e,o[e]):(++p,setTimeout((function(){--p,d(e,o[e])})));else if(a){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||u(e))}d(e,r)}else++p,n.fetch(e,(function(r,s){--p,i&&(r?t?p||u(null,n):u(r):d(e,s))}))}var p=0;l.isString(t)&&(t=[t]);for(var m,b=0;b-1&&this.deferred.splice(t,1)}}else if(e instanceof u)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof i){for(var r=0;r{"use strict";e.exports={}},"../../node_modules/protobufjs/src/rpc.js":(e,t,r)=>{"use strict";t.Service=r("../../node_modules/protobufjs/src/rpc/service.js")},"../../node_modules/protobufjs/src/rpc/service.js":(e,t,r)=>{"use strict";e.exports=n;var i=r("../../node_modules/protobufjs/src/util/minimal.js");function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(i.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,s,o){if(!s)throw TypeError("request must be specified");var a=this;if(!o)return i.asPromise(e,a,t,r,n,s);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,r){if(e)return a.emit("error",e,t),o(e);if(null!==r){if(!(r instanceof n))try{r=n[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",r,t),o(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},"../../node_modules/protobufjs/src/service.js":(e,t,r)=>{"use strict";e.exports=a;var i=r("../../node_modules/protobufjs/src/namespace.js");((a.prototype=Object.create(i.prototype)).constructor=a).className="Service";var n=r("../../node_modules/protobufjs/src/method.js"),s=r("../../node_modules/protobufjs/src/util.js"),o=r("../../node_modules/protobufjs/src/rpc.js");function a(e,t){i.call(this,e,t),this.methods={},this._methodsArray=null}function u(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var i=Object.keys(t.methods),s=0;s{"use strict";e.exports=y;var i=r("../../node_modules/protobufjs/src/namespace.js");((y.prototype=Object.create(i.prototype)).constructor=y).className="Type";var n=r("../../node_modules/protobufjs/src/enum.js"),s=r("../../node_modules/protobufjs/src/oneof.js"),o=r("../../node_modules/protobufjs/src/field.js"),a=r("../../node_modules/protobufjs/src/mapfield.js"),u=r("../../node_modules/protobufjs/src/service.js"),h=r("../../node_modules/protobufjs/src/message.js"),l=r("../../node_modules/protobufjs/src/reader.js"),d=r("../../node_modules/protobufjs/src/writer.js"),c=r("../../node_modules/protobufjs/src/util.js"),f=r("../../node_modules/protobufjs/src/encoder.js"),p=r("../../node_modules/protobufjs/src/decoder.js"),m=r("../../node_modules/protobufjs/src/verifier.js"),b=r("../../node_modules/protobufjs/src/converter.js"),g=r("../../node_modules/protobufjs/src/wrappers.js");function y(e,t){i.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(y.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t{"use strict";var i=t,n=r("../../node_modules/protobufjs/src/util.js"),s=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(e,t){var r=0,i={};for(t|=0;r{"use strict";var i,n,s=e.exports=r("../../node_modules/protobufjs/src/util/minimal.js"),o=r("../../node_modules/protobufjs/src/roots.js");s.codegen=r("../../node_modules/@protobufjs/codegen/index.js"),s.fetch=r("../../node_modules/@protobufjs/fetch/index.js"),s.path=r("../../node_modules/@protobufjs/path/index.js"),s.fs=s.inquire("fs"),s.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),i=0;i0)t[n]=e(t[n]||{},r,i);else{var s=t[n];s&&(i=[].concat(s).concat(i)),t[n]=i}return t}(e,t=t.split("."),r)},Object.defineProperty(s,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(r("../../node_modules/protobufjs/src/root.js")))}})},"../../node_modules/protobufjs/src/util/longbits.js":(e,t,r)=>{"use strict";e.exports=n;var i=r("../../node_modules/protobufjs/src/util/minimal.js");function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=n.zero=new n(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var r=e>>>0,i=(e-r)/4294967296>>>0;return t&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new n(r,i)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(i.isString(e)){if(!i.Long)return n.fromNumber(parseInt(e,10));e=i.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):s},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===o?s:new n((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},"../../node_modules/protobufjs/src/util/minimal.js":function(e,t,r){"use strict";var i=t;function n(e,t,r){for(var i=Object.keys(t),n=0;n0)},i.Buffer=function(){try{var Buffer=i.inquire("buffer").Buffer;return Buffer.prototype.utf8Write?Buffer:null}catch(e){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(e){return"number"==typeof e?i.Buffer?i._Buffer_allocUnsafe(e):new i.Array(e):i.Buffer?i._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var r=i.LongBits.fromHash(e);return i.Long?i.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},i.merge=n,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=s,i.ProtocolError=s("ProtocolError"),i.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},i.oneOfSetter=function(e){return function(t){for(var r=0;r{"use strict";e.exports=function(e){var t=n.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r=e.oneofsArray,i={};r.length&&t("var p={}");for(var u=0;u{"use strict";var i=t,n=r("../../node_modules/protobufjs/src/message.js");i[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var i="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===i.indexOf("/")&&(i="/"+i),this.create({type_url:i,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",i="";if(t&&t.json&&e.type_url&&e.value){i=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var s=this.lookup(i);s&&(e=s.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof n){var o=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),i=r+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),o["@type"]=i,o}return this.toObject(e,t)}}},"../../node_modules/protobufjs/src/writer.js":(e,t,r)=>{"use strict";e.exports=d;var i,n=r("../../node_modules/protobufjs/src/util/minimal.js"),s=n.LongBits,o=n.base64,a=n.utf8;function u(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function h(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new u(h,0,0),this.tail=this.head,this.states=null}var c=function(){return n.Buffer?function(){return(d.create=function(){return new i})()}:function(){return new d}};function f(e,t,r){t[r]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function b(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}d.create=c(),d.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(d.alloc=n.pool(d.alloc,n.Array.prototype.subarray)),d.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,s.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=s.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(f,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(b,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=s.from(e);return this._push(b,4,t.lo)._push(b,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var g=n.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=d.alloc(t=o.length(e));o.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},d.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(f,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(h,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(h,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},d._configure=function(e){i=e,d.create=c(),i._configure()}},"../../node_modules/protobufjs/src/writer_buffer.js":(e,t,r)=>{"use strict";e.exports=s;var i=r("../../node_modules/protobufjs/src/writer.js");(s.prototype=Object.create(i.prototype)).constructor=s;var n=r("../../node_modules/protobufjs/src/util/minimal.js");function s(){i.call(this)}function o(e,t,r){e.length<40?n.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}s._configure=function(){s.alloc=n._Buffer_allocUnsafe,s.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var i=0;i>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=n.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},s._configure()},"../../node_modules/public-encrypt/browser.js":(e,t,r)=>{t.publicEncrypt=r("../../node_modules/public-encrypt/publicEncrypt.js"),t.privateDecrypt=r("../../node_modules/public-encrypt/privateDecrypt.js"),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},"../../node_modules/public-encrypt/mgf.js":(e,t,r)=>{var i=r("../../node_modules/create-hash/browser.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function n(e){var t=Buffer.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){for(var r,s=Buffer.alloc(0),o=0;s.length=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=a(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,u=o/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,t.length-1),f=Math.max(0,h-e.length+1);f<=c;f++){var p=h-f|0;l+=(o=(n=0|e.words[p])*(s=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o>>24-n&16777215)||o!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,u="le"===t,h=new e(s),l=this.clone();if(u){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),h[a]=o;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,f=0|o[1],p=8191&f,m=f>>>13,b=0|o[2],g=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,T=0|o[5],I=8191&T,O=T>>>13,A=0|o[6],j=8191&A,k=A>>>13,x=0|o[7],R=8191&x,P=x>>>13,N=0|o[8],C=8191&N,B=N>>>13,U=0|o[9],D=8191&U,L=U>>>13,q=0|a[0],F=8191&q,z=q>>>13,H=0|a[1],V=8191&H,G=H>>>13,W=0|a[2],K=8191&W,$=W>>>13,Z=0|a[3],Y=8191&Z,X=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,le=0|a[8],de=8191&le,ce=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,z))+Math.imul(c,F)|0))<<13)|0;h=((s=Math.imul(c,z))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,s=Math.imul(m,z);var ge=(h+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((s=s+Math.imul(c,G)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,s=Math.imul(y,z),i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,G)|0;var ye=(h+(i=i+Math.imul(d,K)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,K)|0))<<13)|0;h=((s=s+Math.imul(c,$)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(_,F)|0,s=Math.imul(_,z),i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,$)|0;var ve=(h+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,Y)|0))<<13)|0;h=((s=s+Math.imul(c,X)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(S,F)|0,s=Math.imul(S,z),i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(g,K)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,$)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,X)|0;var we=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(c,Q)|0))<<13)|0;h=((s=s+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(O,F)|0,s=Math.imul(O,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,$)|0,i=i+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((s=s+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(k,F)|0,s=Math.imul(k,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(O,V)|0,s=s+Math.imul(O,G)|0,i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,s=s+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(d,se)|0)|0)+((8191&(n=(n=n+Math.imul(d,oe)|0)+Math.imul(c,se)|0))<<13)|0;h=((s=s+Math.imul(c,oe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,z))+Math.imul(P,F)|0,s=Math.imul(P,z),i=i+Math.imul(j,V)|0,n=(n=n+Math.imul(j,G)|0)+Math.imul(k,V)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(O,K)|0,s=s+Math.imul(O,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0;var Ee=(h+(i=i+Math.imul(d,ue)|0)|0)+((8191&(n=(n=n+Math.imul(d,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((s=s+Math.imul(c,he)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,z))+Math.imul(B,F)|0,s=Math.imul(B,z),i=i+Math.imul(R,V)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,$)|0)+Math.imul(k,K)|0,s=s+Math.imul(k,$)|0,i=i+Math.imul(I,Y)|0,n=(n=n+Math.imul(I,X)|0)+Math.imul(O,Y)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(g,se)|0,n=(n=n+Math.imul(g,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,s=s+Math.imul(m,he)|0;var Se=(h+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ce)|0)+Math.imul(c,de)|0))<<13)|0;h=((s=s+Math.imul(c,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,z))+Math.imul(L,F)|0,s=Math.imul(L,z),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,G)|0,i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,K)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,X)|0)+Math.imul(k,Y)|0,s=s+Math.imul(k,X)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(w,se)|0,n=(n=n+Math.imul(w,oe)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(g,ue)|0,n=(n=n+Math.imul(g,he)|0)+Math.imul(y,ue)|0,s=s+Math.imul(y,he)|0,i=i+Math.imul(p,de)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,de)|0,s=s+Math.imul(m,ce)|0;var Te=(h+(i=i+Math.imul(d,pe)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((s=s+Math.imul(c,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,G))+Math.imul(L,V)|0,s=Math.imul(L,G),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,X)|0,i=i+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(O,re)|0,s=s+Math.imul(O,ie)|0,i=i+Math.imul(E,se)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,s=s+Math.imul(_,he)|0,i=i+Math.imul(g,de)|0,n=(n=n+Math.imul(g,ce)|0)+Math.imul(y,de)|0,s=s+Math.imul(y,ce)|0;var Ie=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((s=s+Math.imul(m,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,$))+Math.imul(L,K)|0,s=Math.imul(L,$),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(j,re)|0,n=(n=n+Math.imul(j,ie)|0)+Math.imul(k,re)|0,s=s+Math.imul(k,ie)|0,i=i+Math.imul(I,se)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(O,se)|0,s=s+Math.imul(O,oe)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(S,ue)|0,s=s+Math.imul(S,he)|0,i=i+Math.imul(w,de)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,de)|0,s=s+Math.imul(_,ce)|0;var Oe=(h+(i=i+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,me)|0)+Math.imul(y,pe)|0))<<13)|0;h=((s=s+Math.imul(y,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(L,Y)|0,s=Math.imul(L,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(j,se)|0,n=(n=n+Math.imul(j,oe)|0)+Math.imul(k,se)|0,s=s+Math.imul(k,oe)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(O,ue)|0,s=s+Math.imul(O,he)|0,i=i+Math.imul(E,de)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(S,de)|0,s=s+Math.imul(S,ce)|0;var Ae=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((s=s+Math.imul(_,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(L,Q)|0,s=Math.imul(L,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(B,re)|0,s=s+Math.imul(B,ie)|0,i=i+Math.imul(R,se)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(j,ue)|0,n=(n=n+Math.imul(j,he)|0)+Math.imul(k,ue)|0,s=s+Math.imul(k,he)|0,i=i+Math.imul(I,de)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(O,de)|0,s=s+Math.imul(O,ce)|0;var je=(h+(i=i+Math.imul(E,pe)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;h=((s=s+Math.imul(S,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(L,re)|0,s=Math.imul(L,ie),i=i+Math.imul(C,se)|0,n=(n=n+Math.imul(C,oe)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,oe)|0,i=i+Math.imul(R,ue)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(P,ue)|0,s=s+Math.imul(P,he)|0,i=i+Math.imul(j,de)|0,n=(n=n+Math.imul(j,ce)|0)+Math.imul(k,de)|0,s=s+Math.imul(k,ce)|0;var ke=(h+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((s=s+Math.imul(O,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,se),n=(n=Math.imul(D,oe))+Math.imul(L,se)|0,s=Math.imul(L,oe),i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(B,ue)|0,s=s+Math.imul(B,he)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,ce)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,ce)|0;var xe=(h+(i=i+Math.imul(j,pe)|0)|0)+((8191&(n=(n=n+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((s=s+Math.imul(k,me)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(D,ue),n=(n=Math.imul(D,he))+Math.imul(L,ue)|0,s=Math.imul(L,he),i=i+Math.imul(C,de)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,ce)|0;var Re=(h+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((s=s+Math.imul(P,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,de),n=(n=Math.imul(D,ce))+Math.imul(L,de)|0,s=Math.imul(L,ce);var Pe=(h+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((s=s+Math.imul(B,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(h+(i=Math.imul(D,pe))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(L,pe)|0))<<13)|0;return h=((s=Math.imul(L,me))+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=be,u[1]=ge,u[2]=ye,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Ee,u[8]=Se,u[9]=Te,u[10]=Ie,u[11]=Oe,u[12]=Ae,u[13]=je,u[14]=ke,u[15]=xe,u[16]=Re,u[17]=Pe,u[18]=Ne,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=c),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i>=1;return i},m.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=s>>>26,this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-s|d>>>s,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==t){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/o|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return b[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(e,n.addn(1).iushrn(1)),f=this.pow(e,n),p=o;0!==f.cmp(a);){for(var m=f,b=0;0!==m.cmp(a);b++)m=m.redSqr();i(b=0;i--){for(var h=t.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}u=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},n(E,M),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/public-encrypt/privateDecrypt.js":(e,t,r)=>{var i=r("../../node_modules/parse-asn1/index.js"),n=r("../../node_modules/public-encrypt/mgf.js"),s=r("../../node_modules/public-encrypt/xor.js"),o=r("../../node_modules/public-encrypt/node_modules/bn.js/lib/bn.js"),a=r("../../node_modules/browserify-rsa/index.js"),u=r("../../node_modules/create-hash/browser.js"),h=r("../../node_modules/public-encrypt/withPublic.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e,t,r){var l;l=e.padding?e.padding:r?1:4;var d,c=i(e),f=c.modulus.byteLength();if(t.length>f||new o(t).cmp(c.modulus)>=0)throw new Error("decryption error");d=r?h(new o(t),c):a(t,c);var p=Buffer.alloc(f-d.length);if(d=Buffer.concat([p,d],f),4===l)return function(e,t){var r=e.modulus.byteLength(),i=u("sha1").update(Buffer.alloc(0)).digest(),o=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,o+1),h=t.slice(o+1),l=s(a,n(h,o)),d=s(h,n(l,r-o-1));if(function(e,t){e=Buffer.from(e),t=Buffer.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){s++;break}var o=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&s++;o.length<8&&s++;if(s)throw new Error("decryption error");return t.slice(n)}(0,d,r);if(3===l)return d;throw new Error("unknown padding")}},"../../node_modules/public-encrypt/publicEncrypt.js":(e,t,r)=>{var i=r("../../node_modules/parse-asn1/index.js"),n=r("../../node_modules/randombytes/browser.js"),s=r("../../node_modules/create-hash/browser.js"),o=r("../../node_modules/public-encrypt/mgf.js"),a=r("../../node_modules/public-encrypt/xor.js"),u=r("../../node_modules/public-encrypt/node_modules/bn.js/lib/bn.js"),h=r("../../node_modules/public-encrypt/withPublic.js"),l=r("../../node_modules/browserify-rsa/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e,t,r){var d;d=e.padding?e.padding:r?1:4;var c,f=i(e);if(4===d)c=function(e,t){var r=e.modulus.byteLength(),i=t.length,h=s("sha1").update(Buffer.alloc(0)).digest(),l=h.length,d=2*l;if(i>r-d-2)throw new Error("message too long");var c=Buffer.alloc(r-i-d-2),f=r-l-1,p=n(l),m=a(Buffer.concat([h,c,Buffer.alloc(1,1),t],f),o(p,f)),b=a(p,o(m,l));return new u(Buffer.concat([Buffer.alloc(1),b,m],r))}(f,t);else if(1===d)c=function(e,t,r){var i,s=t.length,o=e.modulus.byteLength();if(s>o-11)throw new Error("message too long");i=r?Buffer.alloc(o-s-3,255):function(e){var t,r=Buffer.allocUnsafe(e),i=0,s=n(2*e),o=0;for(;i=0)throw new Error("data too long for modulus")}return r?l(c,f):h(c,f)}},"../../node_modules/public-encrypt/withPublic.js":(e,t,r)=>{var i=r("../../node_modules/public-encrypt/node_modules/bn.js/lib/bn.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e,t){return Buffer.from(e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed().toArray())}},"../../node_modules/public-encrypt/xor.js":e=>{e.exports=function(e,t){for(var r=e.length,i=-1;++i{var i=r("../../node_modules/bitcoin-ops/index.json");function n(e){return ee.length)return null;r=e.readUInt8(t+1),n=2}else if(s===i.OP_PUSHDATA2){if(t+3>e.length)return null;r=e.readUInt16LE(t+1),n=3}else{if(t+5>e.length)return null;if(s!==i.OP_PUSHDATA4)throw new Error("Unexpected opcode");r=e.readUInt32LE(t+1),n=5}return{opcode:s,number:r,size:n}}}},"../../node_modules/randombytes/browser.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/process/browser.js"),n=65536,s=4294967295;var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=r.g.crypto||r.g.msCrypto;o&&o.getRandomValues?e.exports=function(e,t){if(e>s)throw new RangeError("requested too many random bytes");var r=Buffer.allocUnsafe(e);if(e>0)if(e>n)for(var a=0;a{"use strict";var i=r("../../node_modules/process/browser.js");function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var s=r("../../node_modules/safe-buffer/index.js"),o=r("../../node_modules/randombytes/browser.js"),Buffer=s.Buffer,a=s.kMaxLength,u=r.g.crypto||r.g.msCrypto,h=Math.pow(2,32)-1;function l(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>h||e<0)throw new TypeError("offset must be a uint32");if(e>a||e>t)throw new RangeError("offset out of range")}function d(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>h||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>a)throw new RangeError("buffer too small")}function c(e,t,r,n){if(i.browser){var s=e.buffer,a=new Uint8Array(s,t,r);return u.getRandomValues(a),n?void i.nextTick((function(){n(null,e)})):e}if(!n)return o(r).copy(e,t),e;o(r,(function(r,i){if(r)return n(r);i.copy(e,t),n(null,e)}))}u&&u.getRandomValues||!i.browser?(t.randomFill=function(e,t,i,n){if(!(Buffer.isBuffer(e)||e instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)n=t,t=0,i=e.length;else if("function"==typeof i)n=i,i=e.length-t;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return l(t,e.length),d(i,t,e.length),c(e,t,i,n)},t.randomFillSync=function(e,t,i){void 0===t&&(t=0);if(!(Buffer.isBuffer(e)||e instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(t,e.length),void 0===i&&(i=e.length-t);return d(i,t,e.length),c(e,t,i)}):(t.randomFill=n,t.randomFillSync=n)},"../../node_modules/readable-stream/errors-browser.js":e=>{"use strict";var t={};function r(e,r,i){i||(i=Error);var n=function(e){var t,i;function n(t,i,n){return e.call(this,function(e,t,i){return"string"==typeof r?r:r(e,t,i)}(t,i,n))||this}return i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i,n}(i);n.prototype.name=i.name,n.prototype.code=e,t[e]=n}function i(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,s,o,a;if("string"==typeof t&&(s="not ",t.substr(!o||o<0?0:+o,s.length)===s)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(i(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},"../../node_modules/readable-stream/lib/_stream_duplex.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/process/browser.js"),n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var s=r("../../node_modules/readable-stream/lib/_stream_readable.js"),o=r("../../node_modules/readable-stream/lib/_stream_writable.js");r("../../node_modules/inherits/inherits_browser.js")(l,s);for(var a=n(o.prototype),u=0;u{"use strict";e.exports=n;var i=r("../../node_modules/readable-stream/lib/_stream_transform.js");function n(e){if(!(this instanceof n))return new n(e);i.call(this,e)}r("../../node_modules/inherits/inherits_browser.js")(n,i),n.prototype._transform=function(e,t,r){r(null,e)}},"../../node_modules/readable-stream/lib/_stream_readable.js":(e,t,r)=>{"use strict";var i,n=r("../../node_modules/process/browser.js");e.exports=S,S.ReadableState=E;r("../../node_modules/events/events.js").EventEmitter;var s=function(e,t){return e.listeners(t).length},o=r("../../node_modules/readable-stream/lib/internal/streams/stream-browser.js"),Buffer=r("../../node_modules/buffer/index.js").Buffer,a=r.g.Uint8Array||function(){};var u,h=r("?983a");u=h&&h.debuglog?h.debuglog("stream"):function(){};var l,d,c,f=r("../../node_modules/readable-stream/lib/internal/streams/buffer_list.js"),p=r("../../node_modules/readable-stream/lib/internal/streams/destroy.js"),m=r("../../node_modules/readable-stream/lib/internal/streams/state.js").getHighWaterMark,b=r("../../node_modules/readable-stream/errors-browser.js").q,g=b.ERR_INVALID_ARG_TYPE,y=b.ERR_STREAM_PUSH_AFTER_EOF,v=b.ERR_METHOD_NOT_IMPLEMENTED,w=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r("../../node_modules/inherits/inherits_browser.js")(S,o);var _=p.errorOrDestroy,M=["error","close","destroy","pause","resume"];function E(e,t,n){i=i||r("../../node_modules/readable-stream/lib/_stream_duplex.js"),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",n),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r("../../node_modules/string_decoder/lib/string_decoder.js").s),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function S(e){if(i=i||r("../../node_modules/readable-stream/lib/_stream_duplex.js"),!(this instanceof S))return new S(e);var t=this instanceof i;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function T(e,t,r,i,n){u("readableAddChunk",t);var s,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?j(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,k(e)))}(e,o);else if(n||(s=function(e,t){var r;i=t,Buffer.isBuffer(i)||i instanceof a||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var i;return r}(o,t)),s)_(e,s);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===Buffer.prototype||(t=function(e){return Buffer.from(e)}(t)),i)o.endEmitted?_(e,new w):I(e,o,t,!0);else if(o.ended)_(e,new y);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?I(e,o,t,!1):x(e,o)):I(e,o,t,!1)}else i||(o.reading=!1,x(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function j(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(k,e))}function k(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function x(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){u("readable nexttick read 0"),e.read(0)}function C(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function D(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(L,t,e))}function L(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function q(e,t){for(var r=0,i=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?D(this):j(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&D(this),null;var i,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&D(this)),null!==i&&this.emit("data",i),i},S.prototype._read=function(e){_(this,new v("_read()"))},S.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,u("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?h:b;function a(t,n){u("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",a),r.removeListener("end",h),r.removeListener("end",b),r.removeListener("data",c),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function h(){u("onend"),e.end()}i.endEmitted?n.nextTick(o):r.once("end",o),e.on("unpipe",a);var l=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",l);var d=!1;function c(t){u("ondata");var n=e.write(t);u("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==q(i.pipes,e))&&!d&&(u("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function f(t){u("onerror",t),b(),e.removeListener("error",f),0===s(e,"error")&&_(e,t)}function p(){e.removeListener("finish",m),b()}function m(){u("onfinish"),e.removeListener("close",p),b()}function b(){u("unpipe"),r.unpipe(e)}return r.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",p),e.once("finish",m),e.emit("pipe",r),i.flowing||(u("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,u("on readable",i.length,i.reading),i.length?j(this):i.reading||n.nextTick(N,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(P,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(P,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(C,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(i=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var s=0;s{"use strict";e.exports=l;var i=r("../../node_modules/readable-stream/errors-browser.js").q,n=i.ERR_METHOD_NOT_IMPLEMENTED,s=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,u=r("../../node_modules/readable-stream/lib/_stream_duplex.js");function h(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{"use strict";var i,n=r("../../node_modules/process/browser.js");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var i=e.entry;e.entry=null;for(;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=S,S.WritableState=E;var o={deprecate:r("../../node_modules/util-deprecate/browser.js")},a=r("../../node_modules/readable-stream/lib/internal/streams/stream-browser.js"),Buffer=r("../../node_modules/buffer/index.js").Buffer,u=r.g.Uint8Array||function(){};var h,l=r("../../node_modules/readable-stream/lib/internal/streams/destroy.js"),d=r("../../node_modules/readable-stream/lib/internal/streams/state.js").getHighWaterMark,c=r("../../node_modules/readable-stream/errors-browser.js").q,f=c.ERR_INVALID_ARG_TYPE,p=c.ERR_METHOD_NOT_IMPLEMENTED,m=c.ERR_MULTIPLE_CALLBACK,b=c.ERR_STREAM_CANNOT_PIPE,g=c.ERR_STREAM_DESTROYED,y=c.ERR_STREAM_NULL_VALUES,v=c.ERR_STREAM_WRITE_AFTER_END,w=c.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function M(){}function E(e,t,o){i=i||r("../../node_modules/readable-stream/lib/_stream_duplex.js"),e=e||{},"boolean"!=typeof o&&(o=t instanceof i),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,s=r.writecb;if("function"!=typeof s)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,s){--t.pendingcb,r?(n.nextTick(s,i),n.nextTick(k,e,t),e._writableState.errorEmitted=!0,_(e,i)):(s(i),e._writableState.errorEmitted=!0,_(e,i),k(e,t))}(e,r,i,t,s);else{var o=A(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||O(e,r),i?n.nextTick(I,e,r,o,s):I(e,r,o,s)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function S(e){var t=this instanceof(i=i||r("../../node_modules/readable-stream/lib/_stream_duplex.js"));if(!t&&!h.call(S,this))return new S(e);this._writableState=new E(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function T(e,t,r,i,n,s,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(n,t.onwrite):e._write(n,s,t.onwrite),t.sync=!1}function I(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),k(e,t)}function O(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)n[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;n.allBuffers=u,T(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,l=r.encoding,d=r.callback;if(T(e,t,!1,t.objectMode?1:h.length,h,l,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function A(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function j(e,t){e._final((function(r){t.pendingcb--,r&&_(e,r),t.prefinished=!0,e.emit("prefinish"),k(e,t)}))}function k(e,t){var r=A(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,n.nextTick(j,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}r("../../node_modules/inherits/inherits_browser.js")(S,a),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===S&&(e&&e._writableState instanceof E)}})):h=function(e){return e instanceof this},S.prototype.pipe=function(){_(this,new b)},S.prototype.write=function(e,t,r){var i,s=this._writableState,o=!1,a=!s.objectMode&&(i=e,Buffer.isBuffer(i)||i instanceof u);return a&&!Buffer.isBuffer(e)&&(e=function(e){return Buffer.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=s.defaultEncoding),"function"!=typeof r&&(r=M),s.ending?function(e,t){var r=new v;_(e,r),n.nextTick(t,r)}(this,r):(a||function(e,t,r,i){var s;return null===r?s=new y:"string"==typeof r||t.objectMode||(s=new f("chunk",["string","Buffer"],r)),!s||(_(e,s),n.nextTick(i,s),!1)}(this,s,e,r))&&(s.pendingcb++,o=function(e,t,r,i,n,s){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=Buffer.from(t,r));return t}(t,i,n);i!==o&&(r=!0,n="buffer",i=o)}var a=t.objectMode?1:i.length;t.length+=a;var u=t.length-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new p("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=l.destroy,S.prototype._undestroy=l.undestroy,S.prototype._destroy=function(e,t){t(e)}},"../../node_modules/readable-stream/lib/internal/streams/async_iterator.js":(e,t,r)=>{"use strict";var i,n=r("../../node_modules/process/browser.js"),s=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r("../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js"),u=Symbol("lastResolve"),h=Symbol("lastReject"),l=Symbol("error"),d=Symbol("ended"),c=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function m(e,t){return{value:e,done:t}}function b(e){var t=e[u];if(null!==t){var r=e[p].read();null!==r&&(e[c]=null,e[u]=null,e[h]=null,t(m(r,!1)))}}function g(e){n.nextTick(b,e)}var y=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((o(i={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(null!==t)return s.reject(t);if(this[d])return s.resolve(m(void 0,!0));if(this[p].destroyed)return new s((function(t,r){n.nextTick((function(){e[l]?r(e[l]):t(m(void 0,!0))}))}));var r,i=this[c];if(i)r=new s(function(e,t){return function(r,i){e.then((function(){t[d]?r(m(void 0,!0)):t[f](r,i)}),i)}}(i,this));else{var o=this[p].read();if(null!==o)return s.resolve(m(o,!1));r=new s(this[f])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),o(i,"return",(function(){var e=this;return new s((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(m(void 0,!0))}))}))})),i),y);e.exports=function(e){var t,r=Object.create(v,(o(t={},p,{value:e,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,h,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,d,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var i=r[p].read();i?(r[c]=null,r[u]=null,r[h]=null,e(m(i,!1))):(r[u]=e,r[h]=t)},writable:!0}),t));return r[c]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[h];return null!==t&&(r[c]=null,r[u]=null,r[h]=null,t(e)),void(r[l]=e)}var i=r[u];null!==i&&(r[c]=null,r[u]=null,r[h]=null,i(m(void 0,!0))),r[d]=!0})),e.on("readable",g.bind(null,r)),r}},"../../node_modules/readable-stream/lib/internal/streams/buffer_list.js":(e,t,r)=>{"use strict";function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return Buffer.alloc(0);for(var t,r,i,n=Buffer.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=s.data,r=n,i=o,Buffer.prototype.copy.call(t,r,i),o+=s.data.length,s=s.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(s===n.length?i+=n:i+=n.slice(0,e),0==(e-=s)){s===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(s));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=Buffer.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,s=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,s),0==(e-=s)){s===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(s));break}++i}return this.length-=i,t}},{key:a,value:function(e,t){return o(this,function(e){for(var t=1;t{"use strict";var i=r("../../node_modules/process/browser.js");function n(e,t){o(e,t),s(e)}function s(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.nextTick(o,this,e)):i.nextTick(o,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?i.nextTick(s,r):(r._writableState.errorEmitted=!0,i.nextTick(n,r,e)):i.nextTick(n,r,e):t?(i.nextTick(s,r),t(e)):i.nextTick(s,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}}},"../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/readable-stream/errors-browser.js").q.ERR_STREAM_PREMATURE_CLOSE;function n(){}e.exports=function e(t,r,s){if("function"==typeof r)return e(t,null,r);r||(r={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},"../../node_modules/readable-stream/lib/internal/streams/pipeline.js":(e,t,r)=>{"use strict";var i;var n=r("../../node_modules/readable-stream/errors-browser.js").q,s=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e){e()}function h(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n0,(function(e){l||(l=e),e&&c.forEach(u),s||(c.forEach(u),d(l))}))}));return t.reduce(h)}},"../../node_modules/readable-stream/lib/internal/streams/state.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/readable-stream/errors-browser.js").q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,n){var s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,n,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(n?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},"../../node_modules/readable-stream/lib/internal/streams/stream-browser.js":(e,t,r)=>{e.exports=r("../../node_modules/events/events.js").EventEmitter},"../../node_modules/readable-stream/readable-browser.js":(e,t,r)=>{(t=e.exports=r("../../node_modules/readable-stream/lib/_stream_readable.js")).Stream=t,t.Readable=t,t.Writable=r("../../node_modules/readable-stream/lib/_stream_writable.js"),t.Duplex=r("../../node_modules/readable-stream/lib/_stream_duplex.js"),t.Transform=r("../../node_modules/readable-stream/lib/_stream_transform.js"),t.PassThrough=r("../../node_modules/readable-stream/lib/_stream_passthrough.js"),t.finished=r("../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js"),t.pipeline=r("../../node_modules/readable-stream/lib/internal/streams/pipeline.js")},"../../node_modules/ripemd160/index.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer,i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/hash-base/index.js"),s=new Array(16),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],a=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],h=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function c(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function f(e,t){return e<>>32-t}function p(e,t,r,i,n,s,o,a){return f(e+(t^r^i)+s+o|0,a)+n|0}function m(e,t,r,i,n,s,o,a){return f(e+(t&r|~t&i)+s+o|0,a)+n|0}function b(e,t,r,i,n,s,o,a){return f(e+((t|~r)^i)+s+o|0,a)+n|0}function g(e,t,r,i,n,s,o,a){return f(e+(t&i|r&~i)+s+o|0,a)+n|0}function y(e,t,r,i,n,s,o,a){return f(e+(t^(r|~i))+s+o|0,a)+n|0}i(c,n),c.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,i=0|this._b,n=0|this._c,c=0|this._d,v=0|this._e,w=0|this._a,_=0|this._b,M=0|this._c,E=0|this._d,S=0|this._e,T=0;T<80;T+=1){var I,O;T<16?(I=p(r,i,n,c,v,e[o[T]],l[0],u[T]),O=y(w,_,M,E,S,e[a[T]],d[0],h[T])):T<32?(I=m(r,i,n,c,v,e[o[T]],l[1],u[T]),O=g(w,_,M,E,S,e[a[T]],d[1],h[T])):T<48?(I=b(r,i,n,c,v,e[o[T]],l[2],u[T]),O=b(w,_,M,E,S,e[a[T]],d[2],h[T])):T<64?(I=g(r,i,n,c,v,e[o[T]],l[3],u[T]),O=m(w,_,M,E,S,e[a[T]],d[3],h[T])):(I=y(r,i,n,c,v,e[o[T]],l[4],u[T]),O=p(w,_,M,E,S,e[a[T]],d[4],h[T])),r=v,v=c,c=f(n,10),n=i,i=I,w=S,S=E,E=f(M,10),M=_,_=O}var A=this._b+n+E|0;this._b=this._c+c+S|0,this._c=this._d+v+w|0,this._d=this._e+r+_|0,this._e=this._a+i+M|0,this._a=A},c.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Buffer.alloc?Buffer.alloc(20):new Buffer(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=c},"../../node_modules/safe-buffer/index.js":(e,t,r)=>{ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +var i=r("../../node_modules/buffer/index.js"),Buffer=i.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return Buffer(e,t,r)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?e.exports=i:(n(i,t),t.Buffer=s),s.prototype=Object.create(Buffer.prototype),n(Buffer,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return Buffer(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=Buffer(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Buffer(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},"../../node_modules/safer-buffer/safer.js":(e,t,r)=>{"use strict";var i,n=r("../../node_modules/process/browser.js"),s=r("../../node_modules/buffer/index.js"),Buffer=s.Buffer,o={};for(i in s)s.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(o[i]=s[i]);var a=o.Buffer={};for(i in Buffer)Buffer.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(a[i]=Buffer[i]);if(o.Buffer.prototype=Buffer.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return Buffer(e,t,r)}),a.alloc||(a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=Buffer(e);return t&&0!==t.length?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i}),!o.kStringMaxLength)try{o.kStringMaxLength=n.binding("buffer").kStringMaxLength}catch(e){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),e.exports=o},"../../node_modules/sha.js/hash.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function i(e,t){this._block=Buffer.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=Buffer.from(e,t));for(var r=this._block,i=this._blockSize,n=e.length,s=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},"../../node_modules/sha.js/index.js":(e,t,r)=>{var i=e.exports=function(e){e=e.toLowerCase();var t=i[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};i.sha=r("../../node_modules/sha.js/sha.js"),i.sha1=r("../../node_modules/sha.js/sha1.js"),i.sha224=r("../../node_modules/sha.js/sha224.js"),i.sha256=r("../../node_modules/sha.js/sha256.js"),i.sha384=r("../../node_modules/sha.js/sha384.js"),i.sha512=r("../../node_modules/sha.js/sha512.js")},"../../node_modules/sha.js/sha.js":(e,t,r)=>{var i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function a(){this.init(),this._w=o,n.call(this,64,56)}function u(e){return e<<30|e>>>2}function h(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}i(a,n),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,l=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=r[d-3]^r[d-8]^r[d-14]^r[d-16];for(var c=0;c<80;++c){var f=~~(c/20),p=0|((t=i)<<5|t>>>27)+h(f,n,o,a)+l+r[c]+s[f];l=a,a=o,o=u(n),n=i,i=p}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=l+this._e|0},a.prototype._hash=function(){var e=Buffer.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=a},"../../node_modules/sha.js/sha1.js":(e,t,r)=>{var i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function a(){this.init(),this._w=o,n.call(this,64,56)}function u(e){return e<<5|e>>>27}function h(e){return e<<30|e>>>2}function l(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}i(a,n),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,d=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=(t=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|t>>>31;for(var f=0;f<80;++f){var p=~~(f/20),m=u(i)+l(p,n,o,a)+d+r[f]+s[p]|0;d=a,a=o,o=h(n),n=i,i=m}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=d+this._e|0},a.prototype._hash=function(){var e=Buffer.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=a},"../../node_modules/sha.js/sha224.js":(e,t,r)=>{var i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/sha.js/sha256.js"),s=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=new Array(64);function a(){this.init(),this._w=o,s.call(this,64,56)}i(a,n),a.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},a.prototype._hash=function(){var e=Buffer.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=a},"../../node_modules/sha.js/sha256.js":(e,t,r)=>{var i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=[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],o=new Array(64);function a(){this.init(),this._w=o,n.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function h(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function c(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}i(a,n),a.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},a.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,a=0|this._d,f=0|this._e,p=0|this._f,m=0|this._g,b=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+c(r[g-15])+r[g-16];for(var y=0;y<64;++y){var v=b+d(f)+u(f,p,m)+s[y]+r[y]|0,w=l(i)+h(i,n,o)|0;b=m,m=p,p=f,f=a+v|0,a=o,o=n,n=i,i=v+w|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=f+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=b+this._h|0},a.prototype._hash=function(){var e=Buffer.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=a},"../../node_modules/sha.js/sha384.js":(e,t,r)=>{var i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/sha.js/sha512.js"),s=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=new Array(160);function a(){this.init(),this._w=o,s.call(this,128,112)}i(a,n),a.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},a.prototype._hash=function(){var e=Buffer.allocUnsafe(48);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=a},"../../node_modules/sha.js/sha512.js":(e,t,r)=>{var i=r("../../node_modules/inherits/inherits_browser.js"),n=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],o=new Array(160);function a(){this.init(),this._w=o,n.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function h(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function c(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function p(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function b(e,t){return e>>>0>>0?1:0}i(a,n),a.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},a.prototype._update=function(e){for(var t=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,a=0|this._eh,g=0|this._fh,y=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,M=0|this._cl,E=0|this._dl,S=0|this._el,T=0|this._fl,I=0|this._gl,O=0|this._hl,A=0;A<32;A+=2)t[A]=e.readInt32BE(4*A),t[A+1]=e.readInt32BE(4*A+4);for(;A<160;A+=2){var j=t[A-30],k=t[A-30+1],x=c(j,k),R=f(k,j),P=p(j=t[A-4],k=t[A-4+1]),N=m(k,j),C=t[A-14],B=t[A-14+1],U=t[A-32],D=t[A-32+1],L=R+B|0,q=x+C+b(L,R)|0;q=(q=q+P+b(L=L+N|0,N)|0)+U+b(L=L+D|0,D)|0,t[A]=q,t[A+1]=L}for(var F=0;F<160;F+=2){q=t[F],L=t[F+1];var z=h(r,i,n),H=h(w,_,M),V=l(r,w),G=l(w,r),W=d(a,S),K=d(S,a),$=s[F],Z=s[F+1],Y=u(a,g,y),X=u(S,T,I),J=O+K|0,Q=v+W+b(J,O)|0;Q=(Q=(Q=Q+Y+b(J=J+X|0,X)|0)+$+b(J=J+Z|0,Z)|0)+q+b(J=J+L|0,L)|0;var ee=G+H|0,te=V+z+b(ee,G)|0;v=y,O=I,y=g,I=T,g=a,T=S,a=o+Q+b(S=E+J|0,E)|0,o=n,E=M,n=i,M=_,i=r,_=w,r=Q+te+b(w=J+ee|0,J)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+M|0,this._dl=this._dl+E|0,this._el=this._el+S|0,this._fl=this._fl+T|0,this._gl=this._gl+I|0,this._hl=this._hl+O|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+i+b(this._bl,_)|0,this._ch=this._ch+n+b(this._cl,M)|0,this._dh=this._dh+o+b(this._dl,E)|0,this._eh=this._eh+a+b(this._el,S)|0,this._fh=this._fh+g+b(this._fl,T)|0,this._gh=this._gh+y+b(this._gl,I)|0,this._hh=this._hh+v+b(this._hl,O)|0},a.prototype._hash=function(){var e=Buffer.allocUnsafe(64);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=a},"../../node_modules/stream-browserify/index.js":(e,t,r)=>{e.exports=n;var i=r("../../node_modules/events/events.js").EventEmitter;function n(){i.call(this)}r("../../node_modules/inherits/inherits_browser.js")(n,i),n.Readable=r("../../node_modules/readable-stream/lib/_stream_readable.js"),n.Writable=r("../../node_modules/readable-stream/lib/_stream_writable.js"),n.Duplex=r("../../node_modules/readable-stream/lib/_stream_duplex.js"),n.Transform=r("../../node_modules/readable-stream/lib/_stream_transform.js"),n.PassThrough=r("../../node_modules/readable-stream/lib/_stream_passthrough.js"),n.finished=r("../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js"),n.pipeline=r("../../node_modules/readable-stream/lib/internal/streams/pipeline.js"),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function s(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",s),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",u));var o=!1;function a(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function h(e){if(l(),0===i.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",n),e.removeListener("drain",s),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",h),e.removeListener("error",h),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",h),e.on("error",h),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},"../../node_modules/string_decoder/lib/string_decoder.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=Buffer.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(Buffer.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=a,this.end=u,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=h,this.end=l,t=3;break;default:return this.write=d,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function a(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function h(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function c(e){return e&&e.length?this.write(e):""}t.s=n,n.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return n>0&&(e.lastNeed=n-1),n;if(--i=0)return n>0&&(e.lastNeed=n-2),n;if(--i=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},"../../node_modules/tiny-secp256k1/js.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer;const i=r("../../node_modules/tiny-secp256k1/node_modules/bn.js/lib/bn.js"),n=new(0,r("../../node_modules/elliptic/lib/elliptic.js").ec)("secp256k1"),s=r("../../node_modules/tiny-secp256k1/rfc6979.js"),o=Buffer.alloc(32,0),a=Buffer.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),u=Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),h=n.curve.n,l=h.shrn(1),d=n.curve.g,c="Expected Private",f="Expected Point",p="Expected Tweak",m="Expected Hash",b="Expected Extra Data (32 bytes)";function g(e){return Buffer.isBuffer(e)&&32===e.length}function y(e){return!!g(e)&&e.compare(a)<0}function v(e){if(!Buffer.isBuffer(e))return!1;if(e.length<33)return!1;const t=e[0],r=e.slice(1,33);if(0===r.compare(o))return!1;if(r.compare(u)>=0)return!1;if((2===t||3===t)&&33===e.length){try{T(e)}catch(e){return!1}return!0}const i=e.slice(33);return 0!==i.compare(o)&&(!(i.compare(u)>=0)&&(4===t&&65===e.length))}function w(e){return 4!==e[0]}function _(e){return!!g(e)&&(e.compare(o)>0&&e.compare(a)<0)}function M(e,t){return void 0===e&&void 0!==t?w(t):void 0===e||e}function E(e){return new i(e)}function S(e){return e.toArrayLike(Buffer,"be",32)}function T(e){return n.curve.decodePoint(e)}function I(e,t){return Buffer.from(e._encode(t))}function O(e,t,r){if(!g(e))throw new TypeError(m);if(!_(t))throw new TypeError(c);if(void 0!==r&&!g(r))throw new TypeError(b);const i=E(t),n=E(e);let o,a;s(e,t,(function(e){const t=E(e),r=d.mul(t);return!r.isInfinity()&&(o=r.x.umod(h),0!==o.isZero()&&(a=t.invm(h).mul(n.add(i.mul(o))).umod(h),0!==a.isZero()))}),_,r),a.cmp(l)>0&&(a=h.sub(a));const u=Buffer.allocUnsafe(64);return S(o).copy(u,0),S(a).copy(u,32),u}e.exports={isPoint:v,isPointCompressed:function(e){return!!v(e)&&w(e)},isPrivate:_,pointAdd:function(e,t,r){if(!v(e))throw new TypeError(f);if(!v(t))throw new TypeError(f);const i=T(e),n=T(t),s=i.add(n);return s.isInfinity()?null:I(s,M(r,e))},pointAddScalar:function(e,t,r){if(!v(e))throw new TypeError(f);if(!y(t))throw new TypeError(p);const i=M(r,e),n=T(e);if(0===t.compare(o))return I(n,i);const s=E(t),a=d.mul(s),u=n.add(a);return u.isInfinity()?null:I(u,i)},pointCompress:function(e,t){if(!v(e))throw new TypeError(f);const r=T(e);if(r.isInfinity())throw new TypeError(f);return I(r,M(t,e))},pointFromScalar:function(e,t){if(!_(e))throw new TypeError(c);const r=E(e),i=d.mul(r);return i.isInfinity()?null:I(i,M(t))},pointMultiply:function(e,t,r){if(!v(e))throw new TypeError(f);if(!y(t))throw new TypeError(p);const i=M(r,e),n=T(e),s=E(t),o=n.mul(s);return o.isInfinity()?null:I(o,i)},privateAdd:function(e,t){if(!_(e))throw new TypeError(c);if(!y(t))throw new TypeError(p);const r=E(e),i=E(t),n=S(r.add(i).umod(h));return _(n)?n:null},privateSub:function(e,t){if(!_(e))throw new TypeError(c);if(!y(t))throw new TypeError(p);const r=E(e),i=E(t),n=S(r.sub(i).umod(h));return _(n)?n:null},sign:function(e,t){return O(e,t)},signWithEntropy:function(e,t,r){return O(e,t,r)},verify:function(e,t,r,i){if(!g(e))throw new TypeError(m);if(!v(t))throw new TypeError(f);if(!function(e){const t=e.slice(0,32),r=e.slice(32,64);return Buffer.isBuffer(e)&&64===e.length&&t.compare(a)<0&&r.compare(a)<0}(r))throw new TypeError("Expected Signature");const n=T(t),s=E(r.slice(0,32)),o=E(r.slice(32,64));if(i&&o.cmp(l)>0)return!1;if(s.gtn(0)<=0)return!1;if(o.gtn(0)<=0)return!1;const u=E(e),c=o.invm(h),p=u.mul(c).umod(h),b=s.mul(c).umod(h),y=d.mulAdd(p,n,b);return!y.isInfinity()&&y.x.umod(h).eq(s)}}},"../../node_modules/tiny-secp256k1/node_modules/bn.js/lib/bn.js":function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var Buffer;"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{Buffer="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r("?0a6b").Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)n=a(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,h=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,u=o/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,t.length-1),f=Math.max(0,h-e.length+1);f<=c;f++){var p=h-f|0;l+=(o=(n=0|e.words[p])*(s=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o>>24-n&16777215)||o!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,u="le"===t,h=new e(s),l=this.clone();if(u){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),h[a]=o;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s>>26;for(;0!==n&&s>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,f=0|o[1],p=8191&f,m=f>>>13,b=0|o[2],g=8191&b,y=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,M=0|o[4],E=8191&M,S=M>>>13,T=0|o[5],I=8191&T,O=T>>>13,A=0|o[6],j=8191&A,k=A>>>13,x=0|o[7],R=8191&x,P=x>>>13,N=0|o[8],C=8191&N,B=N>>>13,U=0|o[9],D=8191&U,L=U>>>13,q=0|a[0],F=8191&q,z=q>>>13,H=0|a[1],V=8191&H,G=H>>>13,W=0|a[2],K=8191&W,$=W>>>13,Z=0|a[3],Y=8191&Z,X=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,le=0|a[8],de=8191&le,ce=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,z))+Math.imul(c,F)|0))<<13)|0;h=((s=Math.imul(c,z))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,z))+Math.imul(m,F)|0,s=Math.imul(m,z);var ge=(h+(i=i+Math.imul(d,V)|0)|0)+((8191&(n=(n=n+Math.imul(d,G)|0)+Math.imul(c,V)|0))<<13)|0;h=((s=s+Math.imul(c,G)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,F),n=(n=Math.imul(g,z))+Math.imul(y,F)|0,s=Math.imul(y,z),i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,V)|0,s=s+Math.imul(m,G)|0;var ye=(h+(i=i+Math.imul(d,K)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,K)|0))<<13)|0;h=((s=s+Math.imul(c,$)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(w,F),n=(n=Math.imul(w,z))+Math.imul(_,F)|0,s=Math.imul(_,z),i=i+Math.imul(g,V)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,G)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(m,K)|0,s=s+Math.imul(m,$)|0;var ve=(h+(i=i+Math.imul(d,Y)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,Y)|0))<<13)|0;h=((s=s+Math.imul(c,X)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,z))+Math.imul(S,F)|0,s=Math.imul(S,z),i=i+Math.imul(w,V)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,V)|0,s=s+Math.imul(_,G)|0,i=i+Math.imul(g,K)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,K)|0,s=s+Math.imul(y,$)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,X)|0;var we=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,ee)|0)+Math.imul(c,Q)|0))<<13)|0;h=((s=s+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,z))+Math.imul(O,F)|0,s=Math.imul(O,z),i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,K)|0,s=s+Math.imul(_,$)|0,i=i+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,X)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(d,re)|0)|0)+((8191&(n=(n=n+Math.imul(d,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((s=s+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(j,F),n=(n=Math.imul(j,z))+Math.imul(k,F)|0,s=Math.imul(k,z),i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(O,V)|0,s=s+Math.imul(O,G)|0,i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,K)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(w,Y)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,X)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,s=s+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(d,se)|0)|0)+((8191&(n=(n=n+Math.imul(d,oe)|0)+Math.imul(c,se)|0))<<13)|0;h=((s=s+Math.imul(c,oe)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,z))+Math.imul(P,F)|0,s=Math.imul(P,z),i=i+Math.imul(j,V)|0,n=(n=n+Math.imul(j,G)|0)+Math.imul(k,V)|0,s=s+Math.imul(k,G)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(O,K)|0,s=s+Math.imul(O,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,X)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,i=i+Math.imul(g,re)|0,n=(n=n+Math.imul(g,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0,i=i+Math.imul(p,se)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0;var Ee=(h+(i=i+Math.imul(d,ue)|0)|0)+((8191&(n=(n=n+Math.imul(d,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((s=s+Math.imul(c,he)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(C,F),n=(n=Math.imul(C,z))+Math.imul(B,F)|0,s=Math.imul(B,z),i=i+Math.imul(R,V)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(j,K)|0,n=(n=n+Math.imul(j,$)|0)+Math.imul(k,K)|0,s=s+Math.imul(k,$)|0,i=i+Math.imul(I,Y)|0,n=(n=n+Math.imul(I,X)|0)+Math.imul(O,Y)|0,s=s+Math.imul(O,X)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,s=s+Math.imul(_,ie)|0,i=i+Math.imul(g,se)|0,n=(n=n+Math.imul(g,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,s=s+Math.imul(m,he)|0;var Se=(h+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ce)|0)+Math.imul(c,de)|0))<<13)|0;h=((s=s+Math.imul(c,ce)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,z))+Math.imul(L,F)|0,s=Math.imul(L,z),i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,G)|0,i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(P,K)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(j,Y)|0,n=(n=n+Math.imul(j,X)|0)+Math.imul(k,Y)|0,s=s+Math.imul(k,X)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,s=s+Math.imul(O,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(w,se)|0,n=(n=n+Math.imul(w,oe)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,oe)|0,i=i+Math.imul(g,ue)|0,n=(n=n+Math.imul(g,he)|0)+Math.imul(y,ue)|0,s=s+Math.imul(y,he)|0,i=i+Math.imul(p,de)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,de)|0,s=s+Math.imul(m,ce)|0;var Te=(h+(i=i+Math.imul(d,pe)|0)|0)+((8191&(n=(n=n+Math.imul(d,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((s=s+Math.imul(c,me)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(D,V),n=(n=Math.imul(D,G))+Math.imul(L,V)|0,s=Math.imul(L,G),i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(B,K)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,X)|0,i=i+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,ee)|0)+Math.imul(k,Q)|0,s=s+Math.imul(k,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(O,re)|0,s=s+Math.imul(O,ie)|0,i=i+Math.imul(E,se)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,s=s+Math.imul(_,he)|0,i=i+Math.imul(g,de)|0,n=(n=n+Math.imul(g,ce)|0)+Math.imul(y,de)|0,s=s+Math.imul(y,ce)|0;var Ie=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((s=s+Math.imul(m,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(D,K),n=(n=Math.imul(D,$))+Math.imul(L,K)|0,s=Math.imul(L,$),i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,X)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(j,re)|0,n=(n=n+Math.imul(j,ie)|0)+Math.imul(k,re)|0,s=s+Math.imul(k,ie)|0,i=i+Math.imul(I,se)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(O,se)|0,s=s+Math.imul(O,oe)|0,i=i+Math.imul(E,ue)|0,n=(n=n+Math.imul(E,he)|0)+Math.imul(S,ue)|0,s=s+Math.imul(S,he)|0,i=i+Math.imul(w,de)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,de)|0,s=s+Math.imul(_,ce)|0;var Oe=(h+(i=i+Math.imul(g,pe)|0)|0)+((8191&(n=(n=n+Math.imul(g,me)|0)+Math.imul(y,pe)|0))<<13)|0;h=((s=s+Math.imul(y,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(D,Y),n=(n=Math.imul(D,X))+Math.imul(L,Y)|0,s=Math.imul(L,X),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(j,se)|0,n=(n=n+Math.imul(j,oe)|0)+Math.imul(k,se)|0,s=s+Math.imul(k,oe)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(O,ue)|0,s=s+Math.imul(O,he)|0,i=i+Math.imul(E,de)|0,n=(n=n+Math.imul(E,ce)|0)+Math.imul(S,de)|0,s=s+Math.imul(S,ce)|0;var Ae=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((s=s+Math.imul(_,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(D,Q),n=(n=Math.imul(D,ee))+Math.imul(L,Q)|0,s=Math.imul(L,ee),i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(B,re)|0,s=s+Math.imul(B,ie)|0,i=i+Math.imul(R,se)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(j,ue)|0,n=(n=n+Math.imul(j,he)|0)+Math.imul(k,ue)|0,s=s+Math.imul(k,he)|0,i=i+Math.imul(I,de)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(O,de)|0,s=s+Math.imul(O,ce)|0;var je=(h+(i=i+Math.imul(E,pe)|0)|0)+((8191&(n=(n=n+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;h=((s=s+Math.imul(S,me)|0)+(n>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(D,re),n=(n=Math.imul(D,ie))+Math.imul(L,re)|0,s=Math.imul(L,ie),i=i+Math.imul(C,se)|0,n=(n=n+Math.imul(C,oe)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,oe)|0,i=i+Math.imul(R,ue)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(P,ue)|0,s=s+Math.imul(P,he)|0,i=i+Math.imul(j,de)|0,n=(n=n+Math.imul(j,ce)|0)+Math.imul(k,de)|0,s=s+Math.imul(k,ce)|0;var ke=(h+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((s=s+Math.imul(O,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(D,se),n=(n=Math.imul(D,oe))+Math.imul(L,se)|0,s=Math.imul(L,oe),i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(B,ue)|0,s=s+Math.imul(B,he)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,ce)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,ce)|0;var xe=(h+(i=i+Math.imul(j,pe)|0)|0)+((8191&(n=(n=n+Math.imul(j,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((s=s+Math.imul(k,me)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(D,ue),n=(n=Math.imul(D,he))+Math.imul(L,ue)|0,s=Math.imul(L,he),i=i+Math.imul(C,de)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,ce)|0;var Re=(h+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((s=s+Math.imul(P,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(D,de),n=(n=Math.imul(D,ce))+Math.imul(L,de)|0,s=Math.imul(L,ce);var Pe=(h+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((s=s+Math.imul(B,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(h+(i=Math.imul(D,pe))|0)+((8191&(n=(n=Math.imul(D,me))+Math.imul(L,pe)|0))<<13)|0;return h=((s=Math.imul(L,me))+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=be,u[1]=ge,u[2]=ye,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Ee,u[8]=Se,u[9]=Te,u[10]=Ie,u[11]=Oe,u[12]=Ae,u[13]=je,u[14]=ke,u[15]=xe,u[16]=Re,u[17]=Pe,u[18]=Ne,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=c),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i>=1;return i},m.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=s>>>26,this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-s|d>>>s,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[n+r]=67108863&s}for(;n>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==t){(a=new s(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/o|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),u=new s(1),h=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(d)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(u)):(r.isub(t),a.isub(n),u.isub(o))}return{a,b:u,gcd:r.iushln(h)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return b[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(e,n.addn(1).iushrn(1)),f=this.pow(e,n),p=o;0!==f.cmp(a);){for(var m=f,b=0;0!==m.cmp(a);b++)m=m.redSqr();i(b=0;i--){for(var h=t.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}u=26}return n},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},n(E,M),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/tiny-secp256k1/rfc6979.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer;const i=r("../../node_modules/create-hmac/browser.js"),n=Buffer.alloc(1,1),s=Buffer.alloc(1,0);e.exports=function(e,t,r,o,a){let u=Buffer.alloc(32,0),h=Buffer.alloc(32,1);u=i("sha256",u).update(h).update(s).update(t).update(e).update(a||"").digest(),h=i("sha256",u).update(h).digest(),u=i("sha256",u).update(h).update(n).update(t).update(e).update(a||"").digest(),h=i("sha256",u).update(h).digest(),h=i("sha256",u).update(h).digest();let l=h;for(;!o(l)||!r(l);)u=i("sha256",u).update(h).update(s).digest(),h=i("sha256",u).update(h).digest(),h=i("sha256",u).update(h).digest(),l=h;return l}},"../../node_modules/typeforce/errors.js":(e,t,r)=>{var i=r("../../node_modules/typeforce/native.js");function n(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function s(e){return i.Nil(e)?"":n(e.constructor)}function o(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function a(e){return i.Function(e)?e.toJSON?e.toJSON():n(e):i.Array(e)?"Array":e&&i.Object(e)?"Object":void 0!==e?e:""}function u(e,t,r){var n=function(e){return i.Function(e)?"":i.String(e)?JSON.stringify(e):e&&i.Object(e)?"":e}(t);return"Expected "+a(e)+", got"+(""!==r?" "+r:"")+(""!==n?" "+n:"")}function h(e,t,r){r=r||s(t),this.message=u(e,t,r),o(this,h),this.__type=e,this.__value=t,this.__valueTypeName=r}function l(e,t,r,i,n){e?(n=n||s(i),this.message=function(e,t,r,i,n){var s='" of type ';return"key"===t&&(s='" with key type '),u('property "'+a(r)+s+a(e),i,n)}(e,r,t,i,n)):this.message='Unexpected property "'+t+'"',o(this,h),this.__label=r,this.__property=t,this.__type=e,this.__value=i,this.__valueTypeName=n}h.prototype=Object.create(Error.prototype),h.prototype.constructor=h,l.prototype=Object.create(Error.prototype),l.prototype.constructor=h,e.exports={TfTypeError:h,TfPropertyTypeError:l,tfCustomError:function(e,t){return new h(e,{},t)},tfSubError:function(e,t,r){return e instanceof l?(t=t+"."+e.__property,e=new l(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof h&&(e=new l(e.__type,t,r,e.__value,e.__valueTypeName)),o(e),e},tfJSON:a,getValueTypeName:s}},"../../node_modules/typeforce/extra.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer,i=r("../../node_modules/typeforce/native.js"),n=r("../../node_modules/typeforce/errors.js");function s(e){return Buffer.isBuffer(e)}function o(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function a(e,t){var r=e.toJSON();function i(i){if(!e(i))return!1;if(i.length===t)return!0;throw n.tfCustomError(r+"(Length: "+t+")",r+"(Length: "+i.length+")")}return i.toJSON=function(){return r},i}var u=a.bind(null,i.Array),h=a.bind(null,s),l=a.bind(null,o),d=a.bind(null,i.String);var c=Math.pow(2,53)-1;var f={ArrayN:u,Buffer:s,BufferN:h,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:o,HexN:l,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-c&&e<=c&&Math.floor(e)===e},Range:function(e,t,r){function n(i,n){return r(i,n)&&i>e&&i>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=c&&Math.floor(e)===e}};for(var p in f)f[p].toJSON=function(e){return e}.bind(null,p);e.exports=f},"../../node_modules/typeforce/index.js":(e,t,r)=>{var i=r("../../node_modules/typeforce/errors.js"),n=r("../../node_modules/typeforce/native.js"),s=i.tfJSON,o=i.TfTypeError,a=i.TfPropertyTypeError,u=i.tfSubError,h=i.getValueTypeName,l={arrayOf:function(e,t){function r(r,i){return!!n.Array(r)&&(!n.Nil(r)&&(!(void 0!==t.minLength&&r.lengtht.maxLength)&&((void 0===t.length||r.length===t.length)&&r.every((function(t,r){try{return c(e,t,i)}catch(e){throw u(e,r)}}))))))}return e=d(e),t=t||{},r.toJSON=function(){var r="["+s(e)+"]";return void 0!==t.length?r+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(r+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),r},r},maybe:function e(t){function r(r,i){return n.Nil(r)||t(r,i,e)}return t=d(t),r.toJSON=function(){return"?"+s(t)},r},map:function(e,t){function r(r,i){if(!n.Object(r))return!1;if(n.Nil(r))return!1;for(var s in r){try{t&&c(t,s,i)}catch(e){throw u(e,s,"key")}try{var o=r[s];c(e,o,i)}catch(e){throw u(e,s)}}return!0}return e=d(e),t&&(t=d(t)),r.toJSON=t?function(){return"{"+s(t)+": "+s(e)+"}"}:function(){return"{"+s(e)+"}"},r},object:function(e){var t={};for(var r in e)t[r]=d(e[r]);function i(e,r){if(!n.Object(e))return!1;if(n.Nil(e))return!1;var i;try{for(i in t){c(t[i],e[i],r)}}catch(e){throw u(e,i)}if(r)for(i in e)if(!t[i])throw new a(void 0,i);return!0}return i.toJSON=function(){return s(t)},i},anyOf:function(){var e=[].slice.call(arguments).map(d);function t(t,r){return e.some((function(e){try{return c(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(s).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(d);function t(t,r){return e.every((function(e){try{return c(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(s).join(" & ")},t},quacksLike:function(e){function t(t){return e===h(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(d);function t(t,r){return!n.Nil(t)&&(!n.Nil(t.length)&&((!r||t.length===e.length)&&e.every((function(e,i){try{return c(e,t[i],r)}catch(e){throw u(e,i)}}))))}return t.toJSON=function(){return"("+e.map(s).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function d(e){if(n.String(e))return"?"===e[0]?l.maybe(e.slice(1)):n[e]||l.quacksLike(e);if(e&&n.Object(e)){if(n.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return l.arrayOf(e[0])}return l.object(e)}return n.Function(e)?e:l.value(e)}function c(e,t,r,i){if(n.Function(e)){if(e(t,r))return!0;throw new o(i||e,t)}return c(d(e),t,r)}for(var f in l.oneOf=l.anyOf,n)c[f]=n[f];for(f in l)c[f]=l[f];var p=r("../../node_modules/typeforce/extra.js");for(f in p)c[f]=p[f];c.compile=d,c.TfTypeError=o,c.TfPropertyTypeError=a,e.exports=c},"../../node_modules/typeforce/native.js":e=>{var t={Array:function(e){return null!=e&&e.constructor===Array},Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==typeof e},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var r in t.Null=t.Nil,t)t[r].toJSON=function(e){return e}.bind(null,r);e.exports=t},"../../node_modules/ua-parser-js/src/ua-parser.js":function(e,t,r){var i;!function(n,s){"use strict";var o="function",a="undefined",u="object",h="string",l="major",d="model",c="name",f="type",p="vendor",m="version",b="architecture",g="console",y="mobile",v="tablet",w="smarttv",_="wearable",M="embedded",E="Amazon",S="Apple",T="ASUS",I="BlackBerry",O="Browser",A="Chrome",j="Firefox",k="Google",x="Huawei",R="LG",P="Microsoft",N="Motorola",C="Opera",B="Samsung",U="Sharp",D="Sony",L="Xiaomi",q="Zebra",F="Facebook",z="Chromium OS",H="Mac OS",V=function(e){for(var t={},r=0;r0?2===a.length?typeof a[1]==o?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3===a.length?typeof a[1]!==o||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):s:this[a[0]]=l?a[1].call(this,l,a[2]):s:4===a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):s):this[a]=l||s;d+=2}},Z=function(e,t){for(var r in t)if(typeof t[r]===u&&t[r].length>0){for(var i=0;i2&&(e[d]="iPad",e[f]=v),e},this.getEngine=function(){var e={};return e[c]=s,e[m]=s,$.call(e,i,w.engine),e},this.getOS=function(){var e={};return e[c]=s,e[m]=s,$.call(e,i,w.os),_&&!e[c]&&g&&"Unknown"!=g.platform&&(e[c]=g.platform.replace(/chrome os/i,z).replace(/macos/i,H)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===h&&e.length>350?K(e,350):e,this},this.setUA(i),this};J.VERSION="1.0.35",J.BROWSER=V([c,m,l]),J.CPU=V([b]),J.DEVICE=V([d,p,f,g,y,w,v,_,M]),J.ENGINE=J.OS=V([c,m]),typeof t!==a?(e.exports&&(t=e.exports=J),t.UAParser=J):r.amdO?(i=function(){return J}.call(t,r,t,e))===s||(e.exports=i):typeof n!==a&&(n.UAParser=J);var Q=typeof n!==a&&(n.jQuery||n.Zepto);if(Q&&!Q.ua){var ee=new J;Q.ua=ee.getResult(),Q.ua.get=function(){return ee.getUA()},Q.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var r in t)Q.ua[r]=t[r]}}}("object"==typeof window?window:this)},"../../node_modules/util-deprecate/browser.js":(e,t,r)=>{function i(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},"../../node_modules/varuint-bitcoin/index.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=9007199254740991;function n(e){if(e<0||e>i||e%1!=0)throw new RangeError("value out of range")}function s(e){return n(e),e<253?1:e<=65535?3:e<=4294967295?5:9}e.exports={encode:function e(t,r,i){if(n(t),r||(r=Buffer.allocUnsafe(s(t))),!Buffer.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return i||(i=0),t<253?(r.writeUInt8(t,i),e.bytes=1):t<=65535?(r.writeUInt8(253,i),r.writeUInt16LE(t,i+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,i),r.writeUInt32LE(t,i+1),e.bytes=5):(r.writeUInt8(255,i),r.writeUInt32LE(t>>>0,i+1),r.writeUInt32LE(t/4294967296|0,i+5),e.bytes=9),r},decode:function e(t,r){if(!Buffer.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var i=t.readUInt8(r);if(i<253)return e.bytes=1,i;if(253===i)return e.bytes=3,t.readUInt16LE(r+1);if(254===i)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var s=t.readUInt32LE(r+1),o=4294967296*t.readUInt32LE(r+5)+s;return n(o),o},encodingLength:s}},"../../node_modules/wif/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer,i=r("../../node_modules/wif/node_modules/bs58check/index.js");function n(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function s(e,t,r){var i=new Buffer(r?34:33);return i.writeUInt8(e,0),t.copy(i,1),r&&(i[33]=1),i}e.exports={decode:function(e,t){return n(i.decode(e),t)},decodeRaw:n,encode:function(e,t,r){return"number"==typeof e?i.encode(s(e,t,r)):i.encode(s(e.version,e.privateKey,e.compressed))},encodeRaw:s}},"../../node_modules/wif/node_modules/bs58/index.js":(e,t,r)=>{var i=r("../../node_modules/base-x/src/index.js");e.exports=i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},"../../node_modules/wif/node_modules/bs58check/base.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/wif/node_modules/bs58/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e){function t(t){var r=t.slice(0,-4),i=t.slice(-4),n=e(r);if(!(i[0]^n[0]|i[1]^n[1]|i[2]^n[2]|i[3]^n[3]))return r}return{encode:function(t){var r=e(t);return i.encode(Buffer.concat([t,r],t.length+4))},decode:function(e){var r=t(i.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=i.decodeUnsafe(e);if(r)return t(r)}}}},"../../node_modules/wif/node_modules/bs58check/index.js":(e,t,r)=>{"use strict";var i=r("../../node_modules/create-hash/browser.js"),n=r("../../node_modules/wif/node_modules/bs58check/base.js");e.exports=n((function(e){var t=i("sha256").update(e).digest();return i("sha256").update(t).digest()}))},"?98fd":()=>{},"?2e65":()=>{},"?0749":()=>{},"?e376":()=>{},"?7dc1":()=>{},"?f84f":()=>{},"?4c42":()=>{},"?c86f":()=>{},"?1dff":()=>{},"?983a":()=>{},"?0a6b":()=>{},"../../node_modules/tslib/tslib.es6.mjs":(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>I,__asyncGenerator:()=>T,__asyncValues:()=>O,__await:()=>S,__awaiter:()=>m,__classPrivateFieldGet:()=>R,__classPrivateFieldIn:()=>N,__classPrivateFieldSet:()=>P,__createBinding:()=>g,__decorate:()=>u,__esDecorate:()=>l,__exportStar:()=>y,__extends:()=>s,__generator:()=>b,__importDefault:()=>x,__importStar:()=>k,__makeTemplateObject:()=>A,__metadata:()=>p,__param:()=>h,__propKey:()=>c,__read:()=>w,__rest:()=>a,__runInitializers:()=>d,__setFunctionName:()=>f,__spread:()=>_,__spreadArray:()=>E,__spreadArrays:()=>M,__values:()=>v,default:()=>C});var i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function h(e,t){return function(r,i){t(r,i,e)}}function l(e,t,r,i,n,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,u=i.kind,h="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?i.static?e:e.prototype:null,d=t||(l?Object.getOwnPropertyDescriptor(l,i.name):{}),c=!1,f=r.length-1;f>=0;f--){var p={};for(var m in i)p[m]="access"===m?{}:i[m];for(var m in i.access)p.access[m]=i.access[m];p.addInitializer=function(e){if(c)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var b=(0,r[f])("accessor"===u?{get:d.get,set:d.set}:d[h],p);if("accessor"===u){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(a=o(b.get))&&(d.get=a),(a=o(b.set))&&(d.set=a),(a=o(b.init))&&n.unshift(a)}else(a=o(b))&&("field"===u?n.unshift(a):d[h]=a)}l&&Object.defineProperty(l,i.name,d),c=!0}function d(e,t,r){for(var i=arguments.length>2,n=0;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function _(){for(var e=[],t=0;t1||u(e,t)}))})}function u(e,t){try{(r=s[e](t)).value instanceof S?i.resolve(r.value.v).then(h,l):d(o[0][2],r)}catch(e){d(o[0][3],e)}var r}function h(e){u("next",e)}function l(e){u("throw",e)}function d(e,t){e(t),o.shift(),o.length&&u(o[0][0],o[0][1])}}function I(e){var t,r;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,n){t[i]=e[i]?function(t){return(r=!r)?{value:S(e[i](t)),done:!1}:n?n(t):t}:n}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=v(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new i((function(n,s){(function(e,t,r,n){i.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,s,(t=e[r](t)).done,t.value)}))}}}function A(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var j=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&g(t,e,r);return j(t,e),t}function x(e){return e&&e.__esModule?e:{default:e}}function R(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}function P(e,t,r,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(e,r):n?n.value=r:t.set(e,r),r}function N(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}const C={__extends:s,__assign:o,__rest:a,__decorate:u,__param:h,__metadata:p,__awaiter:m,__generator:b,__createBinding:g,__exportStar:y,__values:v,__read:w,__spread:_,__spreadArrays:M,__spreadArray:E,__await:S,__asyncGenerator:T,__asyncDelegator:I,__asyncValues:O,__makeTemplateObject:A,__importStar:k,__importDefault:x,__classPrivateFieldGet:R,__classPrivateFieldSet:P,__classPrivateFieldIn:N}},"../../node_modules/bitcoin-ops/index.json":e=>{"use strict";e.exports=JSON.parse('{"OP_FALSE":0,"OP_0":0,"OP_PUSHDATA1":76,"OP_PUSHDATA2":77,"OP_PUSHDATA4":78,"OP_1NEGATE":79,"OP_RESERVED":80,"OP_TRUE":81,"OP_1":81,"OP_2":82,"OP_3":83,"OP_4":84,"OP_5":85,"OP_6":86,"OP_7":87,"OP_8":88,"OP_9":89,"OP_10":90,"OP_11":91,"OP_12":92,"OP_13":93,"OP_14":94,"OP_15":95,"OP_16":96,"OP_NOP":97,"OP_VER":98,"OP_IF":99,"OP_NOTIF":100,"OP_VERIF":101,"OP_VERNOTIF":102,"OP_ELSE":103,"OP_ENDIF":104,"OP_VERIFY":105,"OP_RETURN":106,"OP_TOALTSTACK":107,"OP_FROMALTSTACK":108,"OP_2DROP":109,"OP_2DUP":110,"OP_3DUP":111,"OP_2OVER":112,"OP_2ROT":113,"OP_2SWAP":114,"OP_IFDUP":115,"OP_DEPTH":116,"OP_DROP":117,"OP_DUP":118,"OP_NIP":119,"OP_OVER":120,"OP_PICK":121,"OP_ROLL":122,"OP_ROT":123,"OP_SWAP":124,"OP_TUCK":125,"OP_CAT":126,"OP_SUBSTR":127,"OP_LEFT":128,"OP_RIGHT":129,"OP_SIZE":130,"OP_INVERT":131,"OP_AND":132,"OP_OR":133,"OP_XOR":134,"OP_EQUAL":135,"OP_EQUALVERIFY":136,"OP_RESERVED1":137,"OP_RESERVED2":138,"OP_1ADD":139,"OP_1SUB":140,"OP_2MUL":141,"OP_2DIV":142,"OP_NEGATE":143,"OP_ABS":144,"OP_NOT":145,"OP_0NOTEQUAL":146,"OP_ADD":147,"OP_SUB":148,"OP_MUL":149,"OP_DIV":150,"OP_MOD":151,"OP_LSHIFT":152,"OP_RSHIFT":153,"OP_BOOLAND":154,"OP_BOOLOR":155,"OP_NUMEQUAL":156,"OP_NUMEQUALVERIFY":157,"OP_NUMNOTEQUAL":158,"OP_LESSTHAN":159,"OP_GREATERTHAN":160,"OP_LESSTHANOREQUAL":161,"OP_GREATERTHANOREQUAL":162,"OP_MIN":163,"OP_MAX":164,"OP_WITHIN":165,"OP_RIPEMD160":166,"OP_SHA1":167,"OP_SHA256":168,"OP_HASH160":169,"OP_HASH256":170,"OP_CODESEPARATOR":171,"OP_CHECKSIG":172,"OP_CHECKSIGVERIFY":173,"OP_CHECKMULTISIG":174,"OP_CHECKMULTISIGVERIFY":175,"OP_NOP1":176,"OP_NOP2":177,"OP_CHECKLOCKTIMEVERIFY":177,"OP_NOP3":178,"OP_CHECKSEQUENCEVERIFY":178,"OP_NOP4":179,"OP_NOP5":180,"OP_NOP6":181,"OP_NOP7":182,"OP_NOP8":183,"OP_NOP9":184,"OP_NOP10":185,"OP_PUBKEYHASH":253,"OP_PUBKEY":254,"OP_INVALIDOPCODE":255}')},"../../node_modules/browserify-aes/modes/list.json":e=>{"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},"../../node_modules/browserify-sign/browser/algorithms.json":e=>{"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},"../../node_modules/browserify-sign/browser/curves.json":e=>{"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},"../../node_modules/diffie-hellman/lib/primes.json":e=>{"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},"../../node_modules/elliptic/package.json":e=>{"use strict";e.exports={i8:"6.5.4"}},"../../node_modules/parse-asn1/aesid.json":e=>{"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.p="./";var __webpack_exports__={};(()=>{"use strict";var e={};__webpack_require__.r(e),__webpack_require__.d(e,{applyFlags:()=>jt,applySettings:()=>kt,authorizeCoinjoin:()=>xt,backupDevice:()=>Nt,binanceGetAddress:()=>Ct,binanceGetPublicKey:()=>Bt,binanceSignTransaction:()=>Dt,blockchainDisconnect:()=>ir,blockchainEstimateFee:()=>Ir,blockchainGetAccountBalanceHistory:()=>Or,blockchainGetCurrentFiatRates:()=>Ar,blockchainGetFiatRatesForTimestamps:()=>jr,blockchainGetTransactions:()=>kr,blockchainSetCustomBackend:()=>xr,blockchainSubscribe:()=>Rr,blockchainSubscribeFiatRates:()=>Pr,blockchainUnsubscribe:()=>Nr,blockchainUnsubscribeFiatRates:()=>Cr,cancelCoinjoinAuthorization:()=>Rt,cardanoGetAddress:()=>qr,cardanoGetNativeScriptHash:()=>Fr,cardanoGetPublicKey:()=>zr,cardanoSignTransaction:()=>oi,changePin:()=>ai,checkFirmwareAuthenticity:()=>Ns,cipherKeyValue:()=>hi,composeTransaction:()=>Fi,eosGetPublicKey:()=>zi,eosSignTransaction:()=>en,ethereumGetAddress:()=>un,ethereumGetPublicKey:()=>hn,ethereumSignMessage:()=>dn,ethereumSignTransaction:()=>gn,ethereumSignTypedData:()=>On,ethereumVerifyMessage:()=>jn,firmwareUpdate:()=>Bn,getAccountInfo:()=>Dn,getAddress:()=>Ln,getCoinInfo:()=>Fn,getDeviceState:()=>Hn,getFeatures:()=>Gn,getFirmwareHash:()=>Wn,getOwnershipId:()=>Kn,getOwnershipProof:()=>$n,getPublicKey:()=>Zn,getSettings:()=>Xn,nemGetAddress:()=>Jn,nemSignTransaction:()=>rs,pushTransaction:()=>is,rebootToBootloader:()=>ns,recoveryDevice:()=>ss,requestLogin:()=>os,resetDevice:()=>as,rippleGetAddress:()=>us,rippleSignTransaction:()=>hs,setBusy:()=>ls,setProxy:()=>ds,showDeviceTutorial:()=>Pt,signMessage:()=>fs,signTransaction:()=>ms,stellarGetAddress:()=>bs,stellarSignTransaction:()=>ws,tezosGetAddress:()=>_s,tezosGetPublicKey:()=>Ms,tezosSignTransaction:()=>js,unlockPath:()=>ks,verifyMessage:()=>Rs,wipeDevice:()=>Ps});var t=__webpack_require__("../connect/lib/index-browser.js"),events=__webpack_require__("../../node_modules/events/events.js"),r=__webpack_require__.n(events),i=__webpack_require__("../transport/lib/index.js"),n=__webpack_require__("../utils/lib/index.js"),s=__webpack_require__("../../node_modules/cross-fetch/dist/browser-ponyfill.js"),o=__webpack_require__.n(s);const a=async(e,t="text")=>{const r=await o()(e,{credentials:"same-origin"});if(r.ok){if("json"===t){const e=await r.text();return JSON.parse(e)}return"binary"===t?r.arrayBuffer():r.text()}throw new Error(`httpRequest error: ${e} ${r.statusText}`)},u={btc:{high:1,normal:6,economy:36,low:144}},h=(e,t)=>u[e]&&u[e][t]?u[e][t]:-1,l=e=>{const t=e.default_fee_b,r=e.shortcut.toLowerCase(),i=Object.keys(t).sort(((e,r)=>t[r]-t[e])).map((e=>{const i=e.toLowerCase();return{label:i,feePerUnit:t[e].toString(),blocks:h(r,i)}}));return{blockTime:Math.max(1,Math.round(e.blocktime_seconds/60)),dustLimit:e.dust_limit,maxFee:Math.round(e.maxfee_kb/1e3),minFee:Math.round(e.minfee_kb/1e3),defaultFees:i}},d={blockTime:-1,defaultFees:[{label:"normal",feePerUnit:"12",blocks:-1}],minFee:10,maxFee:1e4,dustLimit:-1},c={blockTime:-1,defaultFees:[{label:"normal",feePerUnit:"44",blocks:-1}],minFee:44,maxFee:876277,dustLimit:-1},f={xrp:d,txrp:d,ada:c,tada:c},p=e=>{const t=e.shortcut.toLowerCase();return f[t]||{blockTime:-1,minFee:-1,maxFee:-1,defaultFees:[{label:"normal",feePerUnit:"-1",blocks:-1}],dustLimit:-1}},m={Init_NotInitialized:"TrezorConnect not initialized",Init_AlreadyInitialized:"TrezorConnect has been already initialized",Init_IframeBlocked:"Iframe blocked",Init_IframeTimeout:"Iframe timeout",Init_ManifestMissing:"Manifest not set. Read more at https://github.com/trezor/trezor-suite/blob/develop/docs/packages/connect/index.md",Popup_ConnectionMissing:"Unable to establish connection with iframe",Transport_Missing:"Transport is missing",Transport_InvalidProtobuf:"",Method_InvalidPackage:"This package is not suitable to work with browser. Use @trezor/connect-web package instead",Method_InvalidParameter:"",Method_NotAllowed:"Method not allowed for this configuration",Method_PermissionsNotGranted:"Permissions not granted",Method_Cancel:"Cancelled",Method_Interrupted:"Popup closed",Method_UnknownCoin:"Coin not found",Method_AddressNotMatch:"Addresses do not match",Method_FirmwareUpdate_DownloadFailed:"Failed to download firmware binary",Method_Discovery_BundleException:"",Method_Override:"override",Method_NoResponse:"Call resolved without response",Backend_NotSupported:"BlockchainLink settings not found in coins.json",Backend_WorkerMissing:"",Backend_Disconnected:"Backend disconnected",Backend_Invalid:"Invalid backend",Backend_Error:"",Runtime:"",Device_NotFound:"Device not found",Device_InitializeFailed:"",Device_FwException:"",Device_ModeException:"",Device_Disconnected:"Device disconnected",Device_UsedElsewhere:"Device is used in another window",Device_InvalidState:"Passphrase is incorrect",Device_CallInProgress:"Device call in progress"};class b extends Error{constructor(e,t){super(t),this.code=e,this.message=t}}const g=(e,t)=>new b(e,t||m[e]),y=e=>e&&e.error instanceof Error?{error:e.error.message,code:e.error.code}:e,v=2147483648,w=e=>(e|v)>>>0,_=e=>(2147483647&e)>>>0,M=e=>_(e[1]),E=g("Method_InvalidParameter","Not a valid path"),S=g("Method_InvalidParameter","Path cannot contain negative values"),T=e=>{const t=e.toLowerCase().split("/");if("m"!==t[0])throw E;return t.filter((e=>"m"!==e&&""!==e)).map((e=>{let t=!1;e.endsWith("'")&&(t=!0,e=e.substring(0,e.length-1));let r=parseInt(e,10);if(Number.isNaN(r))throw E;if(r<0)throw S;return t&&(r=w(r)),r}))},I=e=>Array.isArray(e)&&e[0]===w(49),O=e=>Array.isArray(e)&&e[0]===w(84),A=e=>Array.isArray(e)&&(e[0]===w(86)||e[0]===w(10025)),j=e=>{if(!Array.isArray(e)||e.length<1)return;switch(_(e[0])){case 44:return"SPENDADDRESS";case 48:if(e.length<4)return;switch(_(e[3])){case 0:return"SPENDMULTISIG";case 1:return"SPENDP2SHWITNESS";case 2:return"SPENDWITNESS";default:return}case 49:return"SPENDP2SHWITNESS";case 84:return"SPENDWITNESS";case 86:case 10025:return"SPENDTAPROOT";default:return}},k=e=>{if(!Array.isArray(e)||e.length<1)return;switch(_(e[0])){case 44:return"PAYTOADDRESS";case 48:if(e.length<4)return;switch(_(e[3])){case 0:return"PAYTOMULTISIG";case 1:return"PAYTOP2SHWITNESS";case 2:return"PAYTOWITNESS";default:return}case 49:return"PAYTOP2SHWITNESS";case 84:return"PAYTOWITNESS";case 86:case 10025:return"PAYTOTAPROOT";default:return}},x=(e,t=0,r=!1)=>{let i;if("string"==typeof e?i=T(e):Array.isArray(e)&&(i=e.map((e=>{const t=parseInt(e,10);if(Number.isNaN(t))throw E;if(t<0)throw S;return t}))),!i)throw E;if(t>0&&i.length`m/${e.map((e=>{const t=(2147483647&e).toString();return e&v?`${t}'`:t})).join("/")}`,P=e=>(e.address_n&&Array.isArray(e.address_n)&&(e.address_n=e.address_n.map((e=>e>>>0))),e.address_n&&"string"==typeof e.address_n&&(e.address_n=T(e.address_n)),e),N=(e,t)=>t?e.replace("#NETWORK",t.label):e.replace("#NETWORK",""),C=[],B=[],U=[],D=e=>{const t=(0,n.cloneObject)(C);if("string"==typeof e){const r=e.toLowerCase();return t.find((e=>e.name.toLowerCase()===r||e.shortcut.toLowerCase()===r||e.label.toLowerCase()===r))}const r=_(e[1]);return t.find((e=>e.slip44===r))},L=e=>{const t=(0,n.cloneObject)(B);if("string"==typeof e){const r=e.toLowerCase();return t.find((e=>e.name.toLowerCase()===r||e.shortcut.toLowerCase()===r))}const r=_(e[1]);return t.find((e=>e.slip44===r))},q=e=>{const t=(0,n.cloneObject)(U);if("string"==typeof e){const r=e.toLowerCase();return t.find((e=>e.name.toLowerCase()===r||e.shortcut.toLowerCase()===r))}const r=_(e[1]);return t.find((e=>e.slip44===r))},F=e=>e.segwit&&"number"==typeof e.xPubMagicSegwit?{...e.network,bip32:{...e.network.bip32,public:e.xPubMagicSegwit}}:null,z=e=>e.segwit&&"number"==typeof e.xPubMagicSegwitNative?{...e.network,bip32:{...e.network.bip32,public:e.xPubMagicSegwitNative}}:null,H=(e,t)=>{const r=(0,n.cloneObject)(e);if(t[0]===w(84)){const e=z(r);e&&(r.network=e)}else if(t[0]===w(49)){const e=F(r);e&&(r.network=e)}else r.segwit=!1;return r},V=e=>D(e)||L(e)||q(e),G={type:"ethereum",decimals:16,blockTime:-1,defaultFees:[{label:"normal",feePerUnit:"5000000000",feeLimit:"21000",blocks:-1}],minFee:1,maxFee:1e4,dustLimit:-1},W=(e,t)=>{Object.keys(e).forEach((r=>{const i=e[r];U.push({type:t||"misc",blockchainLink:i.blockchain_link,curve:i.curve,label:i.name,name:i.name,shortcut:i.shortcut,slip44:i.slip44,support:i.support,decimals:i.decimals,...p(i)})}))},K=e=>{Object.keys(e).forEach((t=>{switch(t){case"bitcoin":return(e=>{Object.keys(e).forEach((t=>{const r=e[t],i=r.coin_shortcut,n="BTC"===i||"TEST"===i,s={messagePrefix:r.signed_message_header,bech32:r.bech32_prefix,bip32:{public:r.xpub_magic,private:r.xprv_magic},pubKeyHash:r.address_type,scriptHash:r.address_type_p2sh,forkId:r.fork_id,wif:0};C.push({type:"bitcoin",blockchainLink:r.blockchain_link,cashAddrPrefix:r.cashaddr_prefix,label:r.coin_label,name:r.coin_name,shortcut:i,curveName:r.curve_name,forceBip143:r.force_bip143,hashGenesisBlock:r.hash_genesis_block,maxAddressLength:r.max_address_length,maxFeeSatoshiKb:r.maxfee_kb,minAddressLength:r.min_address_length,minFeeSatoshiKb:r.minfee_kb,segwit:r.segwit,slip44:r.slip44,support:r.support,xPubMagic:r.xpub_magic,xPubMagicSegwitNative:r.xpub_magic_segwit_native,xPubMagicSegwit:r.xpub_magic_segwit_p2sh,taproot:r.taproot,network:s,isBitcoin:n,decimals:r.decimals,...l(r)})}))})(e[t]);case"eth":return(e=>{Object.keys(e).forEach((t=>{const r=e[t];B.push({...G,blockchainLink:r.blockchain_link,chainId:r.chain_id,label:r.name,name:r.name,shortcut:r.shortcut,slip44:r.slip44,support:r.support})}))})(e[t]);case"misc":return W(e[t]);case"nem":return W(e[t],"nem")}}))},$=e=>e.reduce(((e,t)=>!t||e.find((e=>e.shortcut===t.shortcut))?e:e.concat(t)),[]),Z=e=>[1,2].includes(e.major_version)&&(!1===e.firmware_present||null==e.bootloader_mode||!0===e.bootloader_mode),Y=(e,t)=>e.filter((e=>(!e.min_bootloader_version||n.versionUtils.isNewerOrEqual(t,e.min_bootloader_version))&&(!e.bootloader_version||n.versionUtils.isNewerOrEqual(e.bootloader_version,t)))),X=(e,t)=>e.filter((e=>n.versionUtils.isNewerOrEqual(t,e.min_firmware_version))),J={1:[],2:[]},Q=(e,t)=>{Object.keys(e).forEach((r=>{const i=e[r];J[t].push({...i})}))},ee=(e,t)=>1===t.major_version&&t.bootloader_mode?null:n.versionUtils.isNewer(e.version,[t.major_version,t.minor_version,t.patch_version]),te=e=>e&&e.length?e.some((e=>e.required)):null,re=(e,t,r)=>{if(1!==t.major_version||r)return;const i=((e,t)=>{const{bootloader_mode:r,major_version:i,minor_version:s,patch_version:o}=t,a=[i,s,o];if(r)return a;const u=e.find((({version:e})=>n.versionUtils.isEqual(e,a)));return u?.bootloader_version||[1,0,0]})(e,t);return n.versionUtils.isNewerOrEqual(i,[1,12,0])?3:n.versionUtils.isNewerOrEqual(i,[1,8,0])?2:1},ie=({features:e,releases:t})=>{if(!Z(e))throw new Error("Features of unexpected shape provided.");if(r=t,!Array.isArray(r)||!r.every((e=>e.version&&e.min_firmware_version&&e.min_bootloader_version)))throw new Error("Release object in unexpected shape.");var r;const i=t[0],s=(({features:e,releases:t})=>{const{bootloader_mode:r,major_version:i,minor_version:s,patch_version:o,fw_major:a,fw_minor:u,fw_patch:h}=e,l=[i,s,o];if(!n.versionUtils.isVersionArray(l))return[];if(2===i&&r){const e=[a,u,h];return n.versionUtils.isVersionArray(e)?X(t,e):Y(t,l)}return 1===i&&r?Y(t,l):X(t,l)})({features:e,releases:t});if(!s.length)return null;const o=1===e.major_version?t:s,a=((e,t)=>t.bootloader_mode?t.firmware_present&&1===t.major_version?null:t.firmware_present&&2===t.major_version?e.filter((e=>n.versionUtils.isNewer(e.version,[t.fw_major,t.fw_minor,t.fw_patch]))):e:e.filter((e=>n.versionUtils.isNewer(e.version,[t.major_version,t.minor_version,t.patch_version]))))(o,e),u=o[0],h=re(t,e,((e,t)=>n.versionUtils.isEqual(e.version,t.version))(s[0],i));return{changelog:a,release:u,isRequired:te(a),isNewer:ee(i,e),intermediaryVersion:h}},ne=e=>J[e],se={version:[],directory:"",packages:[],changelog:""},oe=()=>se;const ae={webusb:__webpack_require__("../transport/lib/constants.js").TREZOR_USB_DESCRIPTORS,whitelist:[{origin:"chrome-extension://imloifkgjagghnncjkhggdhalmcnfklk",priority:1},{origin:"chrome-extension://niebkpllfhmpfbffbfifagfgoamhpflf",priority:1},{origin:"file://",priority:2},{origin:"trezor.io",priority:0},{origin:"sldev.cz",priority:0},{origin:"localhost",priority:0},{origin:"trezoriovpjcahpzkrewelclulmszwbqpzmzgub37gbcjlvluxtruqad.onion",priority:0}],management:[{origin:"trezor.io"},{origin:"sldev.cz"},{origin:"localhost"}],knownHosts:[{origin:"imloifkgjagghnncjkhggdhalmcnfklk",label:"Trezor Password Manager (Develop)",icon:""},{origin:"niebkpllfhmpfbffbfifagfgoamhpflf",label:"Trezor Password Manager",icon:""},{origin:"mnpfhpndmjholfdlhpkjfmjkgppmodaf",label:"MetaMask",icon:""},{origin:"webextension@metamask.io",label:"MetaMask",icon:""},{origin:"nkbihfbeogaeaoehlefnkodbefgpgknn",label:"MetaMask",icon:""},{origin:"file://",label:" ",icon:""}],onionDomains:{"trezor.io":"trezoriovpjcahpzkrewelclulmszwbqpzmzgub37gbcjlvluxtruqad.onion"},assets:[{name:"coins",url:"./data/coins.json"},{name:"coinsEth",url:"./data/coins-eth.json"},{name:"bridge",url:"./data/bridge/releases.json"},{name:"firmware-t1",url:"./data/firmware/1/releases.json"},{name:"firmware-t2",url:"./data/firmware/2/releases.json"}],messages:"./data/messages/messages.json",supportedBrowsers:{chrome:{version:59,download:"https://www.google.com/chrome/",update:"https://support.google.com/chrome/answer/95414"},chromium:{version:59,download:"https://www.chromium.org/",update:"https://www.chromium.org/"},electron:{version:0,download:"https://www.electronjs.org/",update:"https://www.electronjs.org/"},firefox:{version:54,download:"https://www.mozilla.org/en-US/firefox/new/",update:"https://support.mozilla.org/en-US/kb/update-firefox-latest-version"}},supportedFirmware:[{coin:["xrp","txrp"],methods:["getAccountInfo"],min:["0","2.1.0"],max:void 0,comment:["Since firmware 2.1.0 there is a new protobuf field 'destination_tag' in RippleSignTx"]},{coin:["bnb"],min:["1.9.0","2.3.0"],comment:["There were protobuf backwards incompatible changes with introduction of 1.9.0/2.3.0 firmwares"]},{coin:["eth","tsep","tgor"],min:["1.8.0","2.1.0"],comment:["There were protobuf backwards incompatible changes."]},{methods:["rippleGetAddress","rippleSignTransaction"],min:["0","2.1.0"],comment:["Since firmware 2.1.0 there is a new protobuf field 'destination_tag' in RippleSignTx"]},{methods:["cardanoGetAddress","cardanoGetPublicKey"],min:["0","2.3.2"],comment:["Shelley fork support since firmware 2.3.2"]},{methods:["cardanoSignTransaction"],min:["0","2.4.2"],comment:["Non-streamed signing no longer supported"]},{methods:["cardanoGetNativeScriptHash"],min:["0","2.4.3"],comment:["Cardano GetNativeScriptHash call added in 2.4.3"]},{methods:["tezosSignTransaction"],min:["0","2.1.8"],comment:["Since 2.1.8 there are new protobuf fields in tezos transaction (Babylon fork)"]},{methods:["stellarSignTransaction"],min:["1.9.0","2.3.0"],comment:["There were protobuf backwards incompatible changes with introduction of 1.9.0/2.3.0 firmwares"]},{capabilities:["replaceTransaction","amountUnit"],min:["1.9.4","2.3.5"],comment:["new sign tx process since 1.9.4/2.3.5"]},{capabilities:["decreaseOutput"],min:["1.10.0","2.4.0"],comment:["allow reduce output in RBF transaction since 1.10.0/2.4.0"]},{capabilities:["eip1559"],min:["1.10.4","2.4.2"],comment:["new eth transaction pricing mechanism (EIP1559) since 1.10.4/2.4.2"]},{capabilities:["taproot","signMessageNoScriptType"],min:["1.10.4","2.4.3"],comment:["new btc accounts taproot since 1.10.4/2.4.3 (BTC + TEST only)","SignMessage with no_script_type support"]},{coin:["dcr","tdcr"],methods:["signTransaction"],min:["1.10.1","2.4.0"],comment:[""]},{methods:["ethereumSignTypedData"],min:["1.10.5","2.4.3"],comment:["EIP-712 typed signing support added in 1.10.5/2.4.3"]},{capabilities:["eip712-domain-only"],min:["1.10.6","2.4.4"],comment:["EIP-712 domain-only signing, when primaryType=EIP712Domain"]},{capabilities:["coinjoin"],methods:["authorizeCoinjoin","cancelCoinjoinAuthorization","getOwnershipId","getOwnershipProof","setBusy","unlockPath"],min:["1.12.1","2.5.3"]},{methods:["showDeviceTutorial"],min:["0","2.6.1"],comment:["Only on T2B1"]}]};var ue=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;class he{static assets={};static async load(e,t=!0){const r="web"===e.env?`?r=${e.timestamp}`:"";if(this.settings=e,!t)return;const i=ae.assets.map((async e=>{const t=await a(`${e.url}${r}`,"json");this.assets[e.name]=t}));await ue.all(i),this.messages=await a(`${ae.messages}${r}`,"json"),(e=>{const t=e[0],r=t.version.join("."),i=JSON.parse(JSON.stringify(t).replace(/{version}/g,r)),{directory:n}=i,s=i.packages.map((e=>({name:e.name,platform:e.platform,url:`${n}${e.url}`,signature:e.signature?`${n}${e.signature}`:void 0})));se.version=i.version,se.directory=n,se.packages=s})(this.assets.bridge),K({...this.assets.coins,eth:this.assets.coinsEth}),Q(this.assets["firmware-t1"],1),Q(this.assets["firmware-t2"],2)}static getProtobufMessages(){return this.messages}static getSettings(e){return this.settings?"string"==typeof e?this.settings[e]:this.settings:null}static getConfig(){return ae}}var le=__webpack_require__("../utils/lib/typedEventEmitter.js");const de="device-connect",ce="device-connect_unacquired",fe="device-disconnect",pe="device-changed",me="device-acquired",be="device-released",ge="button",ye="pin",ve="passphrase",we="passphrase_on_device",_e="word",Me=(e,t)=>({event:"DEVICE_EVENT",type:e,payload:t});var Ee=__webpack_require__("../../node_modules/crypto-browserify/index.js");const Se={bitcoin:"Bitcoin",ethereum:"Ethereum",eos:"Eos",nem:"NEM",stellar:"Stellar",cardano:"Cardano",ripple:"Ripple",tezos:"Tezos",binance:"Binance"};var Te=__webpack_require__("../utxo-lib/lib/index.js"),Buffer=__webpack_require__("../../node_modules/buffer/index.js").Buffer;const Ie=(e,t,r)=>{const i=Te._K.fromBase58(e,t);return r&&(i.network=r),i.toBase58()},Oe=(e,t)=>{if(76067358===t.bip32.public)return e;const r=Te._K.fromBase58(e);return r.network=t,r.toBase58()},Ae=(e,t)=>{const r=((e,t)=>{const r=Buffer.from(e.chain_code,"hex"),i=Buffer.from(e.public_key,"hex"),n=Te._K.fromPublicKey(i,r,t);return n.__DEPTH=e.depth,n.__INDEX=e.child_num,n.__PARENT_FINGERPRINT=e.fingerprint,n})(e.node,t),i=r.toBase58(),n=Ie(e.xpub,t);if(i!==n)throw g("Runtime",`pubKey2bjsNode: Invalid public key transmission detected. Key: ${i}, Received: ${n}`);return r};function je(e,t,r,i,n){return((e,t,r)=>{const i=e.derive(r).toBase58(),n=t.toBase58();if(i!==n)throw g("Runtime",`checkDerivation: Invalid child cross-check public key. Derived: ${i}, Received: ${n}`)})(Ae(e,i),Ae(t,i),r),e}const ke=(e,t)=>{const r=Te._K.fromBase58(e,t);return{depth:r.depth,child_num:r.index,fingerprint:r.parentFingerprint,public_key:r.publicKey.toString("hex"),chain_code:r.chainCode.toString("hex")}},xe=(e,t)=>("multisig"in t&&t.multisig?.pubkeys&&t.multisig.pubkeys.forEach((t=>{"string"==typeof t.node&&(t.node=ke(t.node,e))})),t),Re=(e,t,r)=>{if(!e)throw g("Method_UnknownCoin");const i="number"==typeof t?t:0,n={purpose:44,coinType:e.slip44,...r};return"bitcoin"===e.type?[w(n.purpose),w(n.coinType),w(i)]:"ADA"===e.shortcut||"tADA"===e.shortcut?[w(1852),w(n.coinType),w(i)]:"ethereum"===e.type?[w(n.purpose),w(n.coinType),w(0),0,i]:"tXRP"===e.shortcut?[w(n.purpose),w(144),w(i),0,0]:[w(n.purpose),w(n.coinType),w(i),0,0]},Pe=(e,t)=>{let r=!1,i="Unknown coin";t?(i=t.label,r=t.segwit):i=(e=>{const t=_(e[1]),r=B.find((e=>e.slip44===t));return r?r.name:"Unknown coin"})(e);const n=_(e[0]);let s=e.length>=3?_(e[2]):-1,o=s+1,a="Export public key",u="";if(45342===n){const t=_(e[1]);s=_(e[3]),o=s+1,a="Export Copay ID of",48===t?u="multisig":44===t&&(u="legacy")}else u=48===n?`${i} multisig`:44===n&&r?`${i} legacy`:84===n&&r?`${i} native segwit`:i;return o>0?`${a} of ${u} account #${o}`:a},Ne=e=>"bitcoin"===e.type||"ADA"===e.shortcut||"tADA"===e.shortcut,Ce="#bada55",Be="#20abd8",Ue="#f4a744",De={"@trezor/connect":`color: ${Be}; background: #000;`,"@trezor/connect-web":`color: ${Be}; background: #000;`,IFrame:`color: ${Ue}; background: #000;`,Core:`color: ${Ue}; background: #000;`,DeviceList:`color: ${Ce}; background: #000;`,Device:`color: ${Ce}; background: #000;`,DeviceCommands:`color: ${Ce}; background: #000;`,"@trezor/transport":`color: ${Ce}; background: #000;`,InteractionTimeout:`color: ${Ce}; background: #000;`,"@trezor/connect-popup":"color: #fbd948; background: #000;"};class Le{constructor(e,t,r){this.prefix=e,this.enabled=t,this.messages=[],this.css="undefined"!=typeof window&&De[e]?De[e]:"",r&&(this.logWriter=r)}addMessage(e,t,...r){const i={level:e,prefix:t,css:this.css,message:r,timestamp:Date.now()};if(this.messages.push(i),this.logWriter)try{this.logWriter.add(i)}catch(e){console.error("There was an error adding log message",e,i)}this.messages.length>100&&this.messages.shift()}setWriter(e){this.logWriter=e}log(...e){this.addMessage("log",this.prefix,...e),this.enabled&&console.log(`%c${this.prefix}`,this.css,...e)}error(...e){this.addMessage("error",this.prefix,...e),this.enabled&&console.error(`%c${this.prefix}`,this.css,...e)}warn(...e){this.addMessage("warn",this.prefix,...e),this.enabled&&console.warn(`%c${this.prefix}`,this.css,...e)}debug(...e){this.addMessage("debug",this.prefix,...e),this.enabled&&(this.css?console.log(`%c${this.prefix}`,this.css,...e):console.log(this.prefix,...e))}}const qe={};let Fe;const ze=(e,t,r)=>{const i=new Le(e,!!t,r||Fe);return qe[e]=i,i};var He=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;const Ve=ze("DeviceCommands"),Ge=e=>{try{return(0,Ee.O6)(e)}catch(e){throw g("Runtime","generateEntropy: Environment does not support crypto random")}},We=(e,t)=>{const r={};return e in r?{...t,...r[e]}:t};class Ke{constructor(e,t,r){this.device=e,this.transport=t,this.sessionId=r,this.disposed=!1}dispose(){this.disposed=!0,this._cancelableRequest=void 0}isDisposed(){return this.disposed}unlockPath(e){return this.typedCall("UnlockPath","UnlockedPathRequest",e)}async getPublicKey(e,t){t&&await this.unlockPath(t);return(await this.typedCall("GetPublicKey","PublicKey",{address_n:e.address_n,coin_name:e.coin_name||"Bitcoin",script_type:e.script_type,show_display:e.show_display,ignore_xpub_magic:e.ignore_xpub_magic,ecdsa_curve_name:e.ecdsa_curve_name})).message}async getHDNode(e,t={}){const r=e.address_n,{coinInfo:i,unlockPath:n}=t,s="boolean"!=typeof t.validation||t.validation;if(!this.device.atLeast(["1.7.2","2.0.10"])||!i)return this.getBitcoinHDNode(r,i);let o,a=null;if(e.script_type||(e.script_type=j(r)),"SPENDP2SHWITNESS"===e.script_type?a=F(i):"SPENDWITNESS"===e.script_type&&(a=z(i)),a||(a=i.network),e.coin_name||(e.coin_name=i.name),e.show_display||!s)o=await this.getPublicKey(e,n);else{const t=0,s=r.concat([t]);o=je(await this.getPublicKey(e,n),await this.getPublicKey({...e,address_n:s},n),t,a,i.network)}const u={path:r,serializedPath:R(r),childNum:o.node.child_num,xpub:o.xpub,chainCode:o.node.chain_code,publicKey:o.node.public_key,fingerprint:o.node.fingerprint,depth:o.node.depth};if(a!==i.network&&(u.xpubSegwit=u.xpub,u.xpub=Ie(o.xpub,a,i.network)),A(r)){const e=`${Number(o.root_fingerprint||0).toString(16).padStart(8,"0")}${u.serializedPath.substring(1)}`;u.xpubSegwit=`tr([${e}]${u.xpub}/<0;1>/*)`}return u}async getBitcoinHDNode(e,t,r=!0){let i;if(r){const t=0,r=e.concat([t]);i=je(await this.getPublicKey({address_n:e}),await this.getPublicKey({address_n:r}),t)}else i=await this.getPublicKey({address_n:e});const n={path:e,serializedPath:R(e),childNum:i.node.child_num,xpub:t?Oe(i.xpub,t.network):i.xpub,chainCode:i.node.chain_code,publicKey:i.node.public_key,fingerprint:i.node.fingerprint,depth:i.node.depth};if(t){const r=z(t),s=F(t);r&&O(e)?n.xpubSegwit=Oe(i.xpub,r):s&&I(e)&&(n.xpubSegwit=Oe(i.xpub,s))}return n}async getAddress({address_n:e,show_display:t,multisig:r,script_type:i},n){i||"SPENDMULTISIG"!==(i=j(e))||r||(i="SPENDADDRESS"),r&&r.pubkeys&&r.pubkeys.forEach((e=>{"string"==typeof e.node&&(e.node=ke(e.node,n.network))}));const s=await this.typedCall("GetAddress","Address",{address_n:e,coin_name:n.name,show_display:t,multisig:r,script_type:i||"SPENDADDRESS"});return{path:e,serializedPath:R(e),address:s.message.address}}async ethereumGetAddress({address_n:e,show_display:t,encoded_network:r}){const i=await this.typedCall("EthereumGetAddress","EthereumAddress",{address_n:e,show_display:t,encoded_network:r});return{path:e,serializedPath:R(e),address:i.message.address}}async ethereumGetPublicKey({address_n:e,show_display:t}){if(!this.device.atLeast(["1.8.1","2.1.0"]))return this.getHDNode({address_n:e});const r=e.concat([0]),i=await this.typedCall("EthereumGetPublicKey","EthereumPublicKey",{address_n:e,show_display:t}),n=await this.typedCall("EthereumGetPublicKey","EthereumPublicKey",{address_n:r,show_display:!1}),s=je(i.message,n.message,0);return{path:e,serializedPath:R(e),childNum:s.node.child_num,xpub:s.xpub,chainCode:s.node.chain_code,publicKey:s.node.public_key,fingerprint:s.node.fingerprint,depth:s.node.depth}}async preauthorize(e){try{return await this.typedCall("DoPreauthorized","PreauthorizedRequest",{}),!0}catch(t){if(e)throw t;return!1}}getDeviceState(e){return this.device.atLeast("2.4.3")?this._getAddressForNetworkType():this._getAddressForNetworkType(e)}async call(e,t={}){Ve.debug("Sending",e,We(e,t)),this.callPromise=this.transport.call({session:this.sessionId,name:e,data:t});const r=await this.callPromise.promise;if(this.callPromise=void 0,!r.success)throw Ve.warn("Received error",r.error),new Error(r.error);return Ve.debug("Received",r.payload.type,We(r.payload.type,r.payload.message)),r.payload}async typedCall(e,t,r){if(this.disposed)throw g("Runtime","typedCall: DeviceCommands already disposed");const i=await this._commonCall(e,r);try{((e,t)=>{if(!(Array.isArray(t)?t:t.split("|")).includes(e.type))throw g("Runtime",`assertType: Response of unexpected type: ${e.type}. Should be ${t}`)})(i,t)}catch(e){throw await this.transport.receive({session:this.sessionId}),e}return i}async _commonCall(e,t){const r=await this.call(e,t);if(this.disposed)throw g("Runtime","typedCall: DeviceCommands already disposed");return this._filterCommonTypes(r)}_filterCommonTypes(e){if(this._cancelableRequestBySend=!1,"Failure"===e.type){const{code:t}=e.message;let{message:r}=e.message;return"Failure_FirmwareError"!==t||r||(r="Firmware installation failed"),"Failure_ActionCancelled"!==t||r||(r="Action cancelled by user"),He.reject(new b(t||"Failure_UnknownCode",r||"Failure_UnknownMessage"))}if("Features"===e.type)return He.resolve(e);if("ButtonRequest"===e.type)return this._cancelableRequestBySend=!0,"_Deprecated_ButtonRequest_PassphraseType"===e.message.code&&(e.message.code="ButtonRequest_PassphraseType"),"ButtonRequest_PassphraseEntry"===e.message.code?this.device.emit(we):this.device.emit(ge,this.device,e.message),this._commonCall("ButtonAck",{});if("EntropyRequest"===e.type)return this._commonCall("EntropyAck",{entropy:Ge(32).toString("hex")});if("PinMatrixRequest"===e.type)return this._promptPin(e.message.type).then((e=>this._commonCall("PinMatrixAck",{pin:e}).then((e=>this.device.features.unlocked?e:this.device.getFeatures().then((()=>e))))),(()=>this._commonCall("Cancel",{})));if("PassphraseRequest"===e.type){const t=this.device.getInternalState(),r=this.device.useLegacyPassphrase(),i=r&&this.device.isT1();return i&&"string"==typeof t?this._commonCall("PassphraseAck",{passphrase:t}):r&&e.message._on_device?(this.device.emit(we),this._commonCall("PassphraseAck",{_state:t})):this._promptPassphrase().then((e=>{const{passphrase:n,passphraseOnDevice:s,cache:o}=e;return i?(this.device.setInternalState(o?n:void 0),this._commonCall("PassphraseAck",{passphrase:n})):r?this._commonCall("PassphraseAck",{passphrase:n,_state:t}):s?this._commonCall("PassphraseAck",{on_device:!0}):this._commonCall("PassphraseAck",{passphrase:n})}),(e=>this._commonCall("Cancel",{}).catch((t=>{throw e||t}))))}if("Deprecated_PassphraseStateRequest"===e.type){const{state:t}=e.message;return this.device.setInternalState(t),this._commonCall("Deprecated_PassphraseStateAck",{})}return"WordRequest"===e.type?this._promptWord(e.message.type).then((e=>this._commonCall("WordAck",{word:e})),(()=>this._commonCall("Cancel",{}))):He.resolve(e)}async _getAddressForNetworkType(e){if(e===Se.cardano){const{message:e}=await this.typedCall("CardanoGetAddress","CardanoAddress",{address_parameters:{address_type:8,address_n:[w(44),w(1815),w(0),0,0],address_n_staking:[]},protocol_magic:42,network_id:0,derivation_type:2});return e.address}{const{message:e}=await this.typedCall("GetAddress","Address",{address_n:[w(44),w(1),w(0),0,0],coin_name:"Testnet",script_type:"SPENDADDRESS"});return e.address}}_promptPin(e){return new He(((t,r)=>{this.device.listenerCount(ye)>0?(this._cancelableRequest=r,this.device.emit(ye,this.device,e,((e,i)=>{this._cancelableRequest=void 0,e||null==i?r(e):t(i)}))):(console.warn("[DeviceCommands] [call] PIN callback not configured, cancelling request"),r(g("Runtime","_promptPin: PIN callback not configured")))}))}_promptPassphrase(){return new He(((e,t)=>{this.device.listenerCount(ve)>0?(this._cancelableRequest=t,this.device.emit(ve,this.device,((r,i)=>{this._cancelableRequest=void 0,i?t(i):e(r)}))):(console.warn("[DeviceCommands] [call] Passphrase callback not configured, cancelling request"),t(g("Runtime","_promptPassphrase: Passphrase callback not configured")))}))}_promptWord(e){return new He(((t,r)=>{this._cancelableRequest=r,this.device.emit(_e,this.device,e,((e,i)=>{this._cancelableRequest=void 0,e||null==i?r(e):t(i.toLocaleLowerCase())}))}))}async getAccountDescriptor(e,t,r){const i=Array.isArray(t)?t:Re(e,t);if("bitcoin"===e.type){const t=await this.getHDNode({address_n:i},{coinInfo:e,validation:!1});return{descriptor:t.xpubSegwit||t.xpub,legacyXpub:t.xpub,address_n:i}}if("ethereum"===e.type){return{descriptor:(await this.ethereumGetAddress({address_n:i})).address,address_n:i}}if("ADA"===e.shortcut||"tADA"===e.shortcut){if(void 0===r)throw new Error("Derivation type is not specified");const{message:e}=await this.typedCall("CardanoGetPublicKey","CardanoPublicKey",{address_n:i,derivation_type:r});return{descriptor:e.xpub,address_n:i}}if("XRP"===e.shortcut||"tXRP"===e.shortcut){const{message:e}=await this.typedCall("RippleGetAddress","RippleAddress",{address_n:i});return{descriptor:e.address,address_n:i}}throw g("Runtime","DeviceCommands.getAccountDescriptor: unsupported coinInfo.type")}async cancel(){if(this._cancelableRequest)return this._cancelableRequest(),void(this._cancelableRequest=void 0);if(this.disposed)return;if(this.dispose(),!this._cancelableRequestBySend)return void(this.callPromise&&await this.callPromise.promise);const{name:e,version:t}=this.transport;if("BridgeTransport"!==e||n.versionUtils.isNewer(t,"2.0.28"))await this.transport.send({session:this.sessionId,name:"Cancel",data:{}}).promise,this.callPromise&&await this.callPromise.promise;else try{await this.device.legacyForceRelease()}catch(e){}}}const $e="UI_EVENT",Ze={TRANSPORT:"ui-no_transport",BOOTLOADER:"ui-device_bootloader_mode",NOT_IN_BOOTLOADER:"ui-device_not_in_bootloader_mode",REQUIRE_MODE:"ui-device_require_mode",INITIALIZE:"ui-device_not_initialized",SEEDLESS:"ui-device_seedless",FIRMWARE_OLD:"ui-device_firmware_old",FIRMWARE_OUTDATED:"ui-device_firmware_outdated",FIRMWARE_NOT_SUPPORTED:"ui-device_firmware_unsupported",FIRMWARE_NOT_COMPATIBLE:"ui-device_firmware_not_compatible",FIRMWARE_NOT_INSTALLED:"ui-device_firmware_not_installed",FIRMWARE_PROGRESS:"ui-firmware-progress",DEVICE_NEEDS_BACKUP:"ui-device_needs_backup",REQUEST_UI_WINDOW:"ui-request_window",CLOSE_UI_WINDOW:"ui-close_window",REQUEST_PERMISSION:"ui-request_permission",REQUEST_CONFIRMATION:"ui-request_confirmation",REQUEST_PIN:"ui-request_pin",INVALID_PIN:"ui-invalid_pin",REQUEST_PASSPHRASE:"ui-request_passphrase",REQUEST_PASSPHRASE_ON_DEVICE:"ui-request_passphrase_on_device",INVALID_PASSPHRASE:"ui-invalid_passphrase",CONNECT:"ui-connect",LOADING:"ui-loading",SET_OPERATION:"ui-set_operation",SELECT_DEVICE:"ui-select_device",SELECT_ACCOUNT:"ui-select_account",SELECT_FEE:"ui-select_fee",UPDATE_CUSTOM_FEE:"ui-update_custom_fee",INSUFFICIENT_FUNDS:"ui-insufficient_funds",REQUEST_BUTTON:"ui-button",REQUEST_WORD:"ui-request_word",LOGIN_CHALLENGE_REQUEST:"ui-login_challenge_request",BUNDLE_PROGRESS:"ui-bundle_progress",ADDRESS_VALIDATION:"ui-address_validation",IFRAME_FAILURE:"ui-iframe_failure"},Ye=(e,t)=>({event:$e,type:e,payload:t}),Xe={...Ze,RECEIVE_PERMISSION:"ui-receive_permission",RECEIVE_CONFIRMATION:"ui-receive_confirmation",RECEIVE_PIN:"ui-receive_pin",RECEIVE_PASSPHRASE:"ui-receive_passphrase",RECEIVE_DEVICE:"ui-receive_device",RECEIVE_ACCOUNT:"ui-receive_account",RECEIVE_FEE:"ui-receive_fee",RECEIVE_WORD:"ui-receive_word",INVALID_PASSPHRASE_ACTION:"ui-invalid_passphrase_action",CHANGE_SETTINGS:"ui-change_settings",LOGIN_CHALLENGE_RESPONSE:"ui-login_challenge_response"};var Je=__webpack_require__("../protobuf/lib/messages.js"),Qe=__webpack_require__("../../node_modules/buffer/index.js").Buffer;const et=["Capability_Bitcoin","Capability_Bitcoin_like","Capability_Crypto","Capability_Ethereum","Capability_NEM","Capability_Stellar","Capability_U2F"],tt=["Capability_Bitcoin","Capability_Bitcoin_like","Capability_Binance","Capability_Cardano","Capability_Crypto","Capability_EOS","Capability_Ethereum","Capability_Monero","Capability_NEM","Capability_Ripple","Capability_Stellar","Capability_Tezos","Capability_U2F"];let rt=function(e){return e.BitcoinOnly="bitcoin-only",e.Regular="regular",e}({});const it={T1B1:{name:"Trezor Model One",colors:{}},T2T1:{name:"Trezor Model T",colors:{}},T2B1:{name:"Trezor Model R",colors:{0:"Black",1:"White"}}};var nt=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;const st=ze("Device");class ot extends le.TypedEmitter{featuresNeedsReload=!1;acquirePromise=void 0;releasePromise=void 0;loaded=!1;inconsistent=!1;keepSession=!1;instance=0;internalState=[];externalState=[];unavailableCapabilities={};networkTypeState=[];name="Trezor";constructor(e,t){super(),this.transport=e,this.originalDescriptor=t,this.firstRunPromise=(0,n.createDeferred)()}static fromDescriptor(e,t){const r={...t,session:null};try{return new ot(e,r)}catch(e){throw st.error("Device.fromDescriptor",e),e}}static createUnacquired(e,t,r){const i=new ot(e,t);return i.unreadableError=r,i}async acquire(){this.acquirePromise=this.transport.acquire({input:{path:this.originalDescriptor.path,previous:this.originalDescriptor.session}});const e=await this.acquirePromise.promise;if(this.acquirePromise=void 0,!e.success)throw this.runPromise&&(this.runPromise.reject(new Error(e.error)),delete this.runPromise),e.error;const t=e.payload;st.debug("Expected session id:",t),this.activitySessionID=t,this.originalDescriptor.session=t,this.commands&&this.commands.dispose(),this.commands=new Ke(this,this.transport,t)}async release(){if(this.isUsedHere()&&!this.keepSession&&this.activitySessionID&&!this.releasePromise){this.commands&&(this.commands.dispose(),this.commands.callPromise&&await this.commands.callPromise.promise),this.releasePromise&&await this.releasePromise,this.releasePromise=this.transport.release({session:this.activitySessionID,path:this.originalDescriptor.path});const e=await this.releasePromise.promise;this.releasePromise=void 0,e.success&&(this.activitySessionID=null,this.originalDescriptor.session=null)}}async cleanup(){this.removeAllListeners(),delete this.runPromise,await this.release()}run(e,t){if(this.runPromise)throw st.warn("Previous call is still running"),g("Device_CallInProgress");t=(e=>(e||(e={}),e))(t);const r=(0,n.createDeferred)();return this.runPromise=r,nt.race([this._runInner(e,t),r.promise])}async override(e){this.acquirePromise&&await this.acquirePromise.promise,this.runPromise&&await this.interruptionFromUser(e),this.releasePromise&&await this.releasePromise.promise}async interruptionFromUser(e){st.debug("interruptionFromUser"),this.runPromise&&(this.runPromise.reject(e),delete this.runPromise),this.commands&&await this.commands.cancel()}interruptionFromOutside(){st.debug("interruptionFromOutside"),this.commands&&this.commands.dispose(),this.runPromise&&(this.runPromise.reject(g("Device_UsedElsewhere")),delete this.runPromise),this.transport.releaseDevice(this.originalDescriptor.path)}async _runInner(e,t){if(this.releasePromise&&await this.releasePromise.promise,!this.isUsedHere()||this.commands?.disposed||!this.getExternalState()){await this.acquire();try{e?await this.initialize(!!t.useEmptyPassphrase,!!t.useCardanoDerivation):await nt.race([this.getFeatures(),new nt(((e,t)=>setTimeout((()=>t(new Error("GetFeatures timeout"))),3e3)))])}catch(e){return this.inconsistent||"GetFeatures timeout"!==e.message?(this.inconsistent=!0,delete this.runPromise,nt.reject(g("Device_InitializeFailed",`Initialize failed: ${e.message} ${e.code?`, code: ${e.code}`:""}`))):(this.inconsistent=!0,this._runInner((()=>nt.resolve({})),t))}}t.keepSession&&(this.keepSession=!0),this.listeners(me).length>0&&this.emit(me),e&&await e(),this.loaded&&this.features&&!t.skipFinalReload&&await this.getFeatures(),(!this.keepSession&&"boolean"!=typeof t.keepSession||!1===t.keepSession)&&(this.keepSession=!1,await this.release()),this.runPromise&&this.runPromise.resolve(),delete this.runPromise,this.loaded||(this.loaded=!0,this.firstRunPromise.resolve(!0))}getCommands(){if(!this.commands)throw g("Runtime","Device: commands not defined");return this.commands}setInstance(e=0){this.instance!==e&&(this.keepSession&&(this.activitySessionID=null,this.keepSession=!1),this.isT1()&&this.useLegacyPassphrase()&&this.setInternalState(void 0)),this.instance=e}getInstance(){return this.instance}setInternalState(e){"string"!=typeof e?delete this.internalState[this.instance]:this.internalState[this.instance]=e}getInternalState(){return this.internalState[this.instance]}setExternalState(e){"string"!=typeof e?(delete this.internalState[this.instance],delete this.externalState[this.instance]):this.externalState[this.instance]=e}getExternalState(){return this.externalState[this.instance]}async validateState(e,t=!1){if(!this.features)return;if(!this.features.unlocked&&t&&await this.getCommands().preauthorize(!1))return;const r=this._altModeChange(e)?void 0:this.getExternalState(),i=`${await this.getCommands().getDeviceState(e)}@${this.features.device_id||"device_id"}:${this.instance}`;if(!this.useLegacyPassphrase()&&this.features.session_id&&this.setInternalState(this.features.session_id),r&&r!==i)return i;r||this.setExternalState(i)}useLegacyPassphrase(){return!this.atLeast(["1.9.0","2.3.0"])}async initialize(e,t){let r;if(this.features){const i=this.useLegacyPassphrase(),n=this.getInternalState();r={},r.derive_cardano=t,!i&&n&&(r.session_id=n),i&&!this.isT1()&&(r.session_id=n,e&&(r._skip_passphrase=e,r.session_id=void 0))}const{message:i}=await this.getCommands().typedCall("Initialize","Features",r);this._updateFeatures(i)}async getFeatures(){const{message:e}=await this.getCommands().typedCall("GetFeatures","Features",{});this._updateFeatures(e)}_updateFeatures(e){const t=(r=e)&&!1!==r.firmware_present?r.capabilities&&r.capabilities.length?r.capabilities:1===r.major_version?et:tt:[];var r;e.capabilities=t;const i=[e.major_version,e.minor_version,e.patch_version],s=this.features&&this.features.capabilities&&this.features.capabilities.join("")!==t.join("");n.versionUtils.isEqual(i.join("."),this.getVersion().join("."))&&!s||(this.unavailableCapabilities=((e,t)=>{const{capabilities:r}=e,i={};if(!r)return i;const s=[e.major_version,e.minor_version,e.patch_version],o=`trezor${e.major_version}`,a=t.filter((e=>!(!e.support||"string"!=typeof e.support[o])||(i[e.shortcut.toLowerCase()]="no-support",!1))),u=a.filter((e=>"bitcoin"===e.type?"Bitcoin"===e.name||"Testnet"===e.name||"Regtest"===e.name?!r.includes("Capability_Bitcoin"):!r.includes("Capability_Bitcoin_like"):"ethereum"===e.type?!r.includes("Capability_Ethereum"):"nem"===e.type?!r.includes("Capability_NEM"):"BNB"===e.shortcut?!r.includes("Capability_Binance"):"ADA"===e.shortcut||"tADA"===e.shortcut?!r.includes("Capability_Cardano"):"XRP"===e.shortcut||"tXRP"===e.shortcut?!r.includes("Capability_Ripple"):!r.includes(`Capability_${e.name}`)));return u.forEach((e=>{i[e.shortcut.toLowerCase()]="no-capability"})),a.filter((e=>!u.includes(e))).forEach((e=>{n.versionUtils.isNewer(e.support[o],s.join("."))&&(i[e.shortcut.toLowerCase()]="update-required",u.push(e))})),ae.supportedFirmware.forEach((e=>{if(!e.capabilities)return;const t=e.min?e.min[s[0]-1]:null,r=e.max?e.max[s[0]-1]:null;if(t&&("0"===t||n.versionUtils.isNewer(t,s.join(".")))){const r="0"===t?"no-support":"update-required";e.capabilities.forEach((e=>{i[e]=r}))}r&&!n.versionUtils.isNewerOrEqual(r,s.join("."))&&e.capabilities.forEach((e=>{i[e]="trezor-connect-outdated"}))})),i})(e,[...C,...B,...U]),this.firmwareStatus=(e=>{if(!1===e.firmware_present)return"none";if(1===e.major_version&&e.bootloader_mode)return"unknown";const t=ie({features:e,releases:J[e.major_version]});return t?t.isRequired?"required":t.isNewer?"outdated":"valid":"unknown"})(e),this.firmwareRelease=(e=>ie({features:e,releases:J[e.major_version]}))(e)),this.features&&this.features.session_id&&!e.session_id&&(e.session_id=this.features.session_id),e.unlocked=e.unlocked??!0;const o=(e=>{const{revision:t}=e;if(!t)return null;if(/^(?=.*[a-f])([a-f0-9]*)$/gi.test(t))return t;const r=Qe.from(t,"hex").toString("utf-8");return/^([a-f0-9])*$/gi.test(r)?r:t})(e);e.revision=o,e.model||1!==e.major_version||(e.model="1"),e.internal_model||(e.internal_model="T"===e.model.toUpperCase()?Je.DeviceModelInternal.T2T1:Je.DeviceModelInternal.T1B1),this.features=e,this.featuresNeedsReload=!1,"bootloader"!==this.getMode()&&(this.firmwareType=e.capabilities&&e.capabilities.length>0&&!e.capabilities.includes("Capability_Bitcoin_like")?rt.BitcoinOnly:rt.Regular);const a=it[e.internal_model];if(this.name=a.name,e?.unit_color){const t=e.unit_color.toString();t in a.colors&&(this.color=a.colors[t])}}isUnacquired(){return void 0===this.features}disconnect(){st.debug("Disconnect cleanup"),this.activitySessionID=null,this.interruptionFromUser(g("Device_Disconnected")),delete this.runPromise}isBootloader(){return this.features&&!!this.features.bootloader_mode}isInitialized(){return this.features&&!!this.features.initialized}isSeedless(){return this.features&&!!this.features.no_backup}isInconsistent(){return this.inconsistent}getVersion(){return this.features?[this.features.major_version,this.features.minor_version,this.features.patch_version]:[]}atLeast(e){if(!this.features)return!1;const t="string"==typeof e?e:e[this.features.major_version-1];return n.versionUtils.isNewerOrEqual(this.getVersion().join("."),t)}isUsed(){return"string"==typeof this.originalDescriptor.session}isUsedHere(){return this.isUsed()&&this.originalDescriptor.session===this.activitySessionID}isUsedElsewhere(){return this.isUsed()&&!this.isUsedHere()}isRunning(){return!!this.runPromise}isLoaded(){return this.loaded}waitForFirstRun(){return this.firstRunPromise.promise}getDevicePath(){return this.originalDescriptor.path}isT1(){return!!this.features&&1===this.features.major_version}hasUnexpectedMode(e,t){if(this.features){if(this.isBootloader()&&!e.includes(Xe.BOOTLOADER))return Xe.BOOTLOADER;if(!this.isInitialized()&&!e.includes(Xe.INITIALIZE))return Xe.INITIALIZE;if(this.isSeedless()&&!e.includes(Xe.SEEDLESS))return Xe.SEEDLESS;if(!this.isBootloader()&&t.includes(Xe.BOOTLOADER))return Xe.NOT_IN_BOOTLOADER}return null}dispose(){if(this.removeAllListeners(),this.isUsedHere()&&this.activitySessionID)try{return this.commands&&this.commands.cancel(),this.transport.release({session:this.activitySessionID,path:this.originalDescriptor.path,onClose:!0})}catch(e){}}getMode(){return this.features.bootloader_mode?"bootloader":this.features.initialized?this.features.no_backup?"seedless":"normal":"initialize"}toMessageObject(){if(this.unreadableError)return{type:"unreadable",path:this.originalDescriptor.path,error:this.unreadableError,label:"Unreadable device",name:this.name};if(this.isUnacquired())return{type:"unacquired",path:this.originalDescriptor.path,label:"Unacquired device",name:this.name};const e=""!==this.features.label&&this.features.label?this.features.label:"My Trezor";let t=this.isUsedElsewhere()?"occupied":"available";return this.featuresNeedsReload&&(t="used"),{type:"acquired",id:this.features.device_id||null,path:this.originalDescriptor.path,label:e,state:this.getExternalState(),status:t,mode:this.getMode(),name:this.name,color:this.color,firmware:this.firmwareStatus,firmwareRelease:this.firmwareRelease,firmwareType:this.firmwareType,features:this.features,unavailableCapabilities:this.unavailableCapabilities}}_getNetworkTypeState(){return this.networkTypeState[this.instance]}_setNetworkTypeState(e){"string"!=typeof e?delete this.networkTypeState[this.instance]:this.networkTypeState[this.instance]=e}_altModeChange(e){const t=this._isAltModeNetworkType(this._getNetworkTypeState()),r=this._isAltModeNetworkType(e);return this._setNetworkTypeState(e),t!==r}_isAltModeNetworkType(e){return!!e&&["cardano"].includes(e)}async legacyForceRelease(){this.isUsedHere()&&(await this.acquire(),await this.getFeatures(),await this.release())}}var at=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;const ut=(e,t)=>{let r;return{promise:new at((i=>{r=setTimeout(i,e,t)})),timeout:r}};var ht=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;const lt=ze("DeviceList");let dt;class ct extends le.TypedEmitter{transports=[];devices={};creatingDevicesDescriptors={};transportStartPending=0;penalizedDevices={};constructor(){super();let{transports:e}=he.getSettings();const{debug:t}=he.getSettings();this.messages=he.getProtobufMessages(),e?.length||(e=["BridgeTransport"]);const r=ze("@trezor/transport",t);e.forEach((e=>{if("string"==typeof e)switch(e){case"WebUsbTransport":this.transports.push(new i.WebUsbTransport({messages:this.messages,logger:r}));break;case"NodeUsbTransport":this.transports.push(new i.NodeUsbTransport({messages:this.messages,logger:r}));break;case"BridgeTransport":this.transports.push(new i.BridgeTransport({latestVersion:oe().version.join("."),messages:this.messages,logger:r}));break;case"UdpTransport":this.transports.push(new i.UdpTransport({logger:r,messages:this.messages}));break;default:throw g("Runtime",`DeviceList.init: transports[] of unexpected type: ${e}`)}else{if(!(e instanceof i.Transport))throw g("Runtime","DeviceList.init: transports[] of unexpected type");this.transports.unshift(e)}}))}async init(){try{let e;lt.debug("Initializing transports");for(const t of this.transports){this.transport=t;const r=await this.transport.init().promise;if(r.success){e=void 0;break}e=r.error}if(e)return void this.emit(i.TRANSPORT.ERROR,e);this.transport.on(i.TRANSPORT.UPDATE,(e=>{e.connected.forEach((async e=>{const t=e.path.toString(),r=he.getSettings("priority"),i=this.getAuthPenalty();if((r||i)&&await ut(501+i+100*r,null).promise,null==e.session)await this._createAndSaveDevice(e);else{const r=this._createUnacquiredDevice(e);this.devices[t]=r,this.emit(ce,r.toMessageObject())}})),e.acquiredElsewhere.forEach((e=>{const t=e.path.toString(),r=this.devices[t];r&&(r.featuresNeedsReload=!0,r.interruptionFromOutside())})),e.released.forEach((e=>{const t=e.path.toString(),r=this.devices[t];r&&!r?.commands?.disposed&&(r.keepSession=!1)})),e.releasedElsewhere.forEach((async e=>{const t=e.path.toString(),r=this.devices[t];await ut(1e3,null).promise,r&&(r.isUsed()||!r.isUnacquired()||r.isInconsistent()||(lt.debug("Create device from unacquired",r.toMessageObject()),await this._createAndSaveDevice(e)))}));[{d:e.changedSessions,e:pe},{d:e.acquired,e:me},{d:e.released,e:be}].forEach((({d:e,e:t})=>{e.forEach((e=>{const r=e.path.toString(),i=this.devices[r];lt.debug("Event",t,i.toMessageObject()),i&&this.emit(t,i.toMessageObject())}))})),e.disconnected.forEach((e=>{const t=e.path.toString(),r=this.devices[t];r&&(r.disconnect(),delete this.devices[t],this.emit(fe,r.toMessageObject()))})),e.descriptors.forEach((e=>{this.devices[e.path]&&(this.devices[e.path].originalDescriptor={session:e.session,path:e.path})}))})),this.transport.on(i.TRANSPORT.ERROR,(e=>{this.emit(i.TRANSPORT.ERROR,e)}));const t=await this.transport.enumerate().promise;if(!t.success)return void this.emit(i.TRANSPORT.ERROR,t.error);const r=t.payload;r.length>0&&he.getSettings("pendingTransportEvent")?(this.transportStartPending=r.length,this.on(de,this.resolveTransportEvent.bind(this)),this.on(ce,this.resolveTransportEvent.bind(this)),dt=setTimeout((()=>{this.emit(i.TRANSPORT.START,this.getTransportInfo())}),1e4)):this.emit(i.TRANSPORT.START,this.getTransportInfo()),this.transport.handleDescriptorsChange(r),this.transport.listen()}catch(e){console.error("DeviceList init error",e)}}resolveTransportEvent(){this.transportStartPending--,dt&&clearTimeout(dt),0===this.transportStartPending&&this.emit(i.TRANSPORT.START,this.getTransportInfo())}async waitForTransportFirstEvent(){await new ht((e=>{const t=()=>{this.removeListener(i.TRANSPORT.START,t),this.removeListener(i.TRANSPORT.ERROR,t),e()};this.on(i.TRANSPORT.START,t),this.on(i.TRANSPORT.ERROR,t)}))}async _createAndSaveDevice(e){lt.debug("Creating Device",e),await this.handle(e)}_createUnacquiredDevice(e){lt.debug("Creating Unacquired Device",e);const t=ot.createUnacquired(this.transport,e);return t.once(me,(()=>{this.emit(de,t.toMessageObject())})),t}_createUnreadableDevice(e,t){return lt.debug("Creating Unreadable Device",e,t),ot.createUnacquired(this.transport,e,t)}getDevice(e){return this.devices[e]}getFirstDevicePath(){return this.asArray()[0].path}asArray(){return this.allDevices().map((e=>e.toMessageObject()))}allDevices(){return Object.keys(this.devices).map((e=>this.devices[e]))}length(){return this.asArray().length}transportType(){return this.transport.name}getTransportInfo(){return{type:this.transportType(),version:this.transport.version,outdated:this.transport.isOutdated}}async dispose(){this.removeAllListeners(),dt&&clearTimeout(dt),await ht.all(this.allDevices().map((e=>e.dispose()))),this.transport.stop()}disconnectDevices(){this.allDevices().forEach((e=>{this.emit(fe,e.toMessageObject())}))}async enumerate(){const e=await this.transport.enumerate().promise;e.success&&e.payload.forEach((e=>{this.devices[e.path]&&(this.devices[e.path].originalDescriptor={session:e.session,path:e.path},this.devices[e.path].activitySessionID=e.session)}))}addAuthPenalty(e){if(!e.isInitialized()||e.isBootloader()||!e.features.device_id)return;const t=e.features.device_id,r=this.penalizedDevices[t]?this.penalizedDevices[t]+500:2e3;this.penalizedDevices[t]=Math.min(r,5e3)}getAuthPenalty(){const{penalizedDevices:e}=this;return Object.keys(e).reduce(((t,r)=>Math.max(t,e[r])),0)}removeAuthPenalty(e){if(!e.isInitialized()||e.isBootloader()||!e.features.device_id)return;const t=e.features.device_id;delete this.penalizedDevices[t]}async handle(e){const t=e.path.toString();this.creatingDevicesDescriptors[t]=e;try{await this._takeAndCreateDevice(e)}catch(r){if(lt.debug("Cannot create device",r),"Device_NotFound"===r.code||r.message===i.TRANSPORT_ERROR.DEVICE_NOT_FOUND||r.message===i.TRANSPORT_ERROR.DEVICE_DISCONNECTED_DURING_ACTION||r.message===i.TRANSPORT_ERROR.UNEXPECTED_ERROR||r.message===i.TRANSPORT_ERROR.INTERFACE_UNABLE_TO_OPEN_DEVICE)delete this.devices[t];else if(r.message===i.TRANSPORT_ERROR.SESSION_WRONG_PREVIOUS)this.enumerate(),this._handleUsedElsewhere(e);else if(r.message?.indexOf("LIBUSB_ERROR")>=0){const e=this._createUnreadableDevice(this.creatingDevicesDescriptors[t],r.message);this.devices[t]=e,this.emit(ce,e.toMessageObject())}else"Device_InitializeFailed"===r.code||"Device_UsedElsewhere"===r.code?this._handleUsedElsewhere(e):(await ut(501,null).promise,await this.handle(e))}delete this.creatingDevicesDescriptors[t]}async _takeAndCreateDevice(e){const t=ot.fromDescriptor(this.transport,e),r=e.path.toString();this.devices[r]=t;const i=t.run();await i,this.emit(de,t.toMessageObject())}_handleUsedElsewhere(e){const t=e.path.toString(),r=this._createUnacquiredDevice(this.creatingDevicesDescriptors[t]);this.devices[t]=r,this.emit(ce,r.toMessageObject())}}const ft="RESPONSE_EVENT",pt=(e,t,r)=>({event:ft,type:ft,id:e,success:t,payload:t?r:y(r)}),mt="popup-handshake",bt="popup-closed",gt="ui-cancel-popup-request",yt=(e,t)=>({event:$e,type:e,payload:t}),vt="iframe-call",wt=(e,t)=>({event:"TRANSPORT_EVENT",type:e,payload:"error"in t?y(t):t});var _t=__webpack_require__("../connect-common/lib/index.js");const Mt=e=>{if("string"!=typeof e)return"unknown";if(0===e.indexOf("file://"))return"file://";const[t]=e.match(/^https?:\/\/[^/]+/)??[];return t??"unknown"},Et=e=>{if("string"!=typeof e)return;const[,,t]=e.match(/^(https?):\/\/([^:/]+)?/i)??[];if(t){const e=t.split(".");return e.length>2?e.slice(e.length-2,e.length).join("."):t}};class St{get info(){return""}constructor(e){const{payload:t}=e;this.name=t.method,this.payload=t,this.responseID=e.id||0,this.devicePath=t.device?.path,this.deviceState=t.device?.state,this.hasExpectedDeviceState=!!t.device&&Object.prototype.hasOwnProperty.call(t.device,"state"),this.keepSession="boolean"==typeof t.keepSession&&t.keepSession,this.skipFinalReload="boolean"==typeof t.skipFinalReload&&t.skipFinalReload,this.skipFirmwareCheck=!1,this.overridePreviousCall="boolean"==typeof t.override&&t.override,this.overridden=!1,this.useEmptyPassphrase="boolean"==typeof t.useEmptyPassphrase&&t.useEmptyPassphrase,this.allowSeedlessDevice="boolean"==typeof t.allowSeedlessDevice&&t.allowSeedlessDevice,this.allowDeviceMode=[],this.requireDeviceMode=[],this.allowSeedlessDevice&&(this.allowDeviceMode=[Xe.SEEDLESS]),this.network="bitcoin",Object.keys(Se).forEach((e=>{this.name.startsWith(e)&&(this.network=e)})),this.firmwareRange={1:{min:"1.0.0",max:"0"},2:{min:"2.0.0",max:"0"}},this.requiredPermissions=[],this.useDevice=!0,this.useDeviceState=!0,this.useUi=!0,this.useCardanoDerivation="boolean"==typeof t.useCardanoDerivation?t.useCardanoDerivation:t.method.startsWith("cardano")}setDevice(e){this.device=e,this.devicePath=e.getDevicePath();const t=this.createUiPromise;this.createUiPromise=(r,i)=>t(r,i||e)}async requestPermissions(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_PERMISSION);this.postMessage(Ye(Xe.REQUEST_PERMISSION,{permissions:this.requiredPermissions,device:this.device.toMessageObject()}));const t=await e.promise,{granted:r,remember:i}=t.payload;return!!r&&(this.savePermissions(!i),!0)}checkPermissions(){const e=_t.storage.load().permissions;let t=[...this.requiredPermissions];if(e){const r=e.filter((e=>e.origin===he.getSettings("origin")));r.length>0&&(t=t.filter((e=>!r.find((t=>t.type===e&&t.device===this.device.features.device_id)))))}this.requiredPermissions=t}savePermissions(e=!1){const t=_t.storage.load(e).permissions||[];let r=this.requiredPermissions.map((e=>({origin:he.getSettings("origin"),type:e,device:this.device.features.device_id||void 0}))),i=!1;if(this.requiredPermissions.indexOf("read")>=0){t.filter((e=>e.origin===he.getSettings("origin")&&"read"===e.type&&e.device===this.device.features.device_id)).length<1&&(i=!0)}const n=t.filter((e=>e.origin===he.getSettings("origin")));n.length>0&&(r=r.filter((e=>!n.find((t=>t.type===e.type&&t.device===e.device))))),_t.storage.save((e=>({...e,permissions:t.concat(r)})),e),i&&this.postMessage(Me(de,this.device.toMessageObject()))}async checkFirmwareRange(e){if(this.skipFirmwareCheck)return;const{device:t}=this;if(!t.features)return;const r=t.getVersion(),i=r[0],s=this.firmwareRange[i];if("none"===t.firmwareStatus)return Xe.FIRMWARE_NOT_INSTALLED;if("0"===s.min)return Xe.FIRMWARE_NOT_SUPPORTED;if("required"===t.firmwareStatus||!n.versionUtils.isNewerOrEqual(r.join("."),s.min))return Xe.FIRMWARE_OLD;if("0"!==s.max&&n.versionUtils.isNewer(r.join("."),s.max)){if(!e)return Xe.FIRMWARE_NOT_COMPATIBLE;{await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.FIRMWARE_NOT_COMPATIBLE,t.toMessageObject()));if(!(await e.promise).payload)throw g("Method_PermissionsNotGranted")}}}isManagementRestricted(){const{popup:e,origin:t}=he.getSettings();if(e&&this.requiredPermissions.includes("management")){const e=Et(t);return!he.getConfig().management.find((r=>r.origin===e||r.origin===t))}}dispose(){}}const Tt=e=>g("Method_InvalidParameter",e);function It(e,t){return t.forEach((t=>{const r=e[t.name];if(t.required&&null==r)throw Tt(`Parameter "${t.name}" is missing.`);if(!t.type||null==r)return;const{name:i,type:n}=t;if(Array.isArray(n)){const e={};e[i]=r;if(!n.reduce(((r,i)=>{try{return It(e,[{name:t.name,type:i}]),r+1}catch(e){return r}}),0))throw Tt(`Parameter "${i}" has invalid type. Union of "${n.join("|")}" expected.`)}else if("array"===n){if(!Array.isArray(r))throw Tt(`Parameter "${i}" has invalid type. "${n}" expected.`);if(!t.allowEmpty&&r.length<1)throw Tt(`Parameter "${i}" is empty.`)}else if("uint"===n){if("string"!=typeof r&&"number"!=typeof r)throw Tt(`Parameter "${i}" has invalid type. "string|number" expected.`);if("number"==typeof r&&!Number.isSafeInteger(r)||!/^(?:[1-9]\d*|\d)$/.test(r.toString().replace(/^-/,t.allowNegative?"":"-")))throw Tt(`Parameter "${i}" has invalid value "${r}". Integer representation expected.`)}else if("array-buffer"===n){if(!(r instanceof ArrayBuffer))throw Tt(`Parameter "${i}" has invalid type. "ArrayBuffer" expected.`)}else if(typeof r!==n)throw Tt(`Parameter "${i}" has invalid type. "${n}" expected.`)})),e}const Ot=(e,t)=>{if(t&&t.slip44!==_(e[1]))throw Tt('Parameters "path" and "coin" do not match.')},At=(e,t,r)=>{const i=JSON.parse(JSON.stringify(r));t&&(t.support&&"string"==typeof t.support.trezor1?n.versionUtils.isNewer(t.support.trezor1,i[1].min)&&(i[1].min=t.support.trezor1):i[1].min="0",t.support&&"string"==typeof t.support.trezor2?n.versionUtils.isNewer(t.support.trezor2,i[2].min)&&(i[2].min=t.support.trezor2):i[2].min="0");const s=t?t.type:null,o=t?t.shortcut.toLowerCase():null,{supportedFirmware:a}=ae;return a.filter((t=>t.methods?t.methods.includes(e):!t.capabilities||t.capabilities.includes(e))).filter((e=>e.coinType?e.coinType===s:e.coin?("string"==typeof e.coin?[e.coin]:e.coin).includes(o):e.methods||e.capabilities)).forEach((e=>{const{min:t,max:r}=e;if(t){const[e,r]=t;"0"!==e&&"0"!==i[1].min&&n.versionUtils.isNewerOrEqual(i[1].min,e)||(i[1].min=e),"0"!==r&&"0"!==i[2].min&&n.versionUtils.isNewerOrEqual(i[2].min,r)||(i[2].min=r)}if(r){const[e,t]=r;"0"!==e&&"0"!==i[1].max&&n.versionUtils.isNewerOrEqual(i[1].max,e)||(i[1].max=e),"0"!==t&&"0"!==i[2].max&&n.versionUtils.isNewerOrEqual(i[2].max,t)||(i[2].max=t)}})),i};class jt extends St{init(){this.requiredPermissions=["management"],this.useDeviceState=!1;const{payload:e}=this;It(e,[{name:"flags",type:"number",required:!0}]),this.params={flags:e.flags}}async confirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"device-management",customConfirmButton:{className:"confirm",label:"Proceed"},label:"Do you really want to apply flags?"}));return(await e.promise).payload}async run(){const e=this.device.getCommands();return(await e.typedCall("ApplyFlags","Success",this.params)).message}}class kt extends St{init(){this.requiredPermissions=["management"],this.useDeviceState=!1;const{payload:e}=this;It(e,[{name:"language",type:"string"},{name:"label",type:"string"},{name:"use_passphrase",type:"boolean"},{name:"homescreen",type:"string"},{name:"passphrase_source",type:"number"},{name:"passphrase_always_on_device",type:"boolean"},{name:"auto_lock_delay_ms",type:"number"},{name:"display_rotation",type:"number"},{name:"safety_checks",type:"string"},{name:"experimental_features",type:"boolean"}]),this.params={language:e.language,label:e.label,use_passphrase:e.use_passphrase,homescreen:e.homescreen,passphrase_always_on_device:e.passphrase_always_on_device,auto_lock_delay_ms:e.auto_lock_delay_ms,display_rotation:e.display_rotation,safety_checks:e.safety_checks,experimental_features:e.experimental_features,_passphrase_source:e.passphrase_source}}async confirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"device-management",customConfirmButton:{className:"confirm",label:"Proceed"},label:"Do you really want to change device settings?"}));return(await e.promise).payload}async run(){const e=this.device.getCommands();return(await e.typedCall("ApplySettings","Success",this.params)).message}}class xt extends St{init(){const{payload:e}=this;It(e,[{name:"path",required:!0},{name:"coordinator",type:"string",required:!0},{name:"maxRounds",type:"number",required:!0},{name:"maxCoordinatorFeeRate",type:"number",required:!0},{name:"maxFeePerKvbyte",type:"number",required:!0},{name:"coin",type:"string"},{name:"scriptType",type:"string"},{name:"amountUnit",type:"uint"},{name:"preauthorized",type:"boolean"}]);const t=x(e.path,3),r=e.scriptType||j(t),i=D(e.coin||t);this.firmwareRange=At(this.name,i,this.firmwareRange),this.preauthorized=e.preauthorized,this.params={coordinator:e.coordinator,max_rounds:e.maxRounds,max_coordinator_fee_rate:e.maxCoordinatorFeeRate,max_fee_per_kvbyte:e.maxFeePerKvbyte,address_n:t,coin_name:i?.name,script_type:r,amount_unit:e.amountUnit}}async run(){const e=this.device.getCommands();if(this.preauthorized&&await e.preauthorize(!1))return{message:"Success"};return(await e.typedCall("AuthorizeCoinJoin","Success",this.params)).message}}class Rt extends St{init(){const{payload:e}=this;this.firmwareRange=At(this.name,null,this.firmwareRange),this.preauthorized="boolean"!=typeof e.preauthorized||e.preauthorized}get info(){return"Cancel Coinjoin Authorization"}async run(){const e=this.device.getCommands();if(!this.preauthorized&&!await e.preauthorize(!1))return{message:"Not authorized"};return(await e.typedCall("CancelAuthorization","Success")).message}}class Pt extends St{init(){this.firmwareRange=At(this.name,null,this.firmwareRange),this.useEmptyPassphrase=!0,this.useDeviceState=!1,this.allowDeviceMode=[Xe.INITIALIZE]}get info(){return"Show device tutorial"}async run(){const e=this.device.getCommands();return(await e.typedCall("ShowDeviceTutorial","Success")).message}}class Nt extends St{init(){this.requiredPermissions=["management"],this.useDeviceState=!1}async confirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"device-management",customConfirmButton:{className:"confirm",label:"Proceed"},label:"Do you want to initiate backup procedure?"}));return(await e.promise).payload}async run(){const e=this.device.getCommands();return(await e.typedCall("BackupDevice","Success")).message}}class Ct extends St{progress=0;init(){this.requiredPermissions=["read"],this.firmwareRange=At(this.name,q("BNB"),this.firmwareRange),this.hasBundle=!!this.payload.bundle;const e=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};It(e,[{name:"bundle",type:"array"},{name:"useEventListener",type:"boolean"}]),this.params=e.bundle.map((e=>{It(e,[{name:"path",required:!0},{name:"address",type:"string"},{name:"showOnTrezor",type:"boolean"}]);return{address_n:x(e.path,3),address:e.address,show_display:"boolean"!=typeof e.showOnTrezor||e.showOnTrezor}}));const t=e.useEventListener&&1===this.params.length&&"string"==typeof this.params[0].address&&this.params[0].show_display;this.confirmed=t,this.useUi=!t}get info(){return 1===this.params.length?`Export Binance address for account #${_(this.params[0].address_n[2])+1}`:"Export multiple Binance addresses"}getButtonRequestData(e){if("ButtonRequest_Address"===e)return{type:"address",serializedPath:R(this.params[this.progress].address_n),address:this.params[this.progress].address||"not-set"}}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:this.info}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async noBackupConfirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await e.promise).payload}async _call({address_n:e,show_display:t}){const r=this.device.getCommands();return(await r.typedCall("BinanceGetAddress","BinanceAddress",{address_n:e,show_display:t})).message}async run(){const e=[];for(let t=0;t{It(e,[{name:"path",required:!0},{name:"showOnTrezor",type:"boolean"}]);return{address_n:x(e.path,3),show_display:"boolean"!=typeof e.showOnTrezor||e.showOnTrezor}}))}get info(){return"Export Binance public key"}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);let t;t=this.params.length>1?"Export multiple Binance public keys":`Export Binance public key for account #${_(this.params[0].address_n[2])+1}`,this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:t}));const r=await e.promise;return this.confirmed=r.payload,this.confirmed}async run(){const e=[],t=this.device.getCommands();for(let r=0;r{const{type:i,...n}=t[r];if(r+1>=t.length){return(await e(i,"BinanceSignedTx",n)).message}return await e(i,"BinanceTxRequest",n),r++,Ut(e,t,r)};class Dt extends St{init(){this.requiredPermissions=["read","write"],this.firmwareRange=At(this.name,q("BNB"),this.firmwareRange);const{payload:e}=this;It(e,[{name:"path",type:"string",required:!0},{name:"transaction",required:!0}]);const t=x(e.path,3),r=(e=>{It(e,[{name:"chain_id",type:"string",required:!0},{name:"account_number",type:"number"},{name:"memo",type:"string"},{name:"sequence",type:"number"},{name:"source",type:"number"},{name:"message",type:"object"}]);const t={chain_id:e.chain_id,account_number:e.account_number||0,memo:e.memo,sequence:e.sequence||0,source:e.source||0,messages:[]},{transfer:r,placeOrder:i,cancelOrder:n}=e;if(r&&(It(r,[{name:"inputs",type:"array",required:!0},{name:"outputs",type:"array",required:!0}]),t.messages.push({...r,type:"BinanceTransferMsg"})),i&&(It(i,[{name:"id",type:"string"},{name:"ordertype",type:"number"},{name:"price",type:"number"},{name:"quantity",type:"number"},{name:"sender",type:"string"},{name:"side",type:"number"}]),t.messages.push({...i,type:"BinanceOrderMsg"})),n&&(It(n,[{name:"refid",type:"string",required:!0},{name:"sender",type:"string",required:!0},{name:"symbol",type:"string",required:!0}]),t.messages.push({...n,type:"BinanceCancelMsg"})),t.messages.length<1)throw g("Method_InvalidParameter","Transaction does not have any message");return t})(e.transaction);this.params={path:t,transaction:r}}get info(){return"Sign Binance transaction"}run(){return(async(e,t,r)=>{const{account_number:i,chain_id:n,memo:s,sequence:o,source:a,messages:u}=r,h=u.length;return await e("BinanceSignTx","BinanceTxRequest",{address_n:t,msg_count:h,account_number:i,chain_id:n,memo:s,sequence:o,source:a}),Ut(e,u,0)})(this.device.getCommands().typedCall.bind(this.device.getCommands()),this.params.path,this.params.transaction)}}var Lt=__webpack_require__("../blockchain-link/lib/index.js");const qt="blockchain-connect",Ft="blockchain-error",zt="blockchain-block",Ht="blockchain-notification",Vt="fiat-rates-update",Gt=(e,t)=>({event:"BLOCKCHAIN_EVENT",type:e,payload:t});function Wt(){return new Worker(__webpack_require__.p+"./workers/blockbook-worker.0e43b55c4eaca985c610.js")}function Kt(){return new Worker(__webpack_require__.p+"./workers/ripple-worker.fb9d5bcfa2137ebed9ad.js")}function $t(){return new Worker(__webpack_require__.p+"./workers/blockfrost-worker.82cb4a83f1909b418465.js")}var Zt=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;class Yt{feeForBlock=[];feeTimestamp=0;constructor(e){this.coinInfo=e.coinInfo,this.postMessage=e.postMessage,this.onConnected=e.onConnected,this.onDisconnected=e.onDisconnected;const{blockchainLink:t}=e.coinInfo;if(!t)throw g("Backend_NotSupported");const r=(e=>{switch(e){case"blockbook":return Wt;case"ripple":return Kt;case"blockfrost":return $t;case"electrum":return;default:return null}})(t.type);if(!r)throw g("Backend_WorkerMissing",`BlockchainLink worker not found ${t.type}`);const i=t.url;this.link=new Lt.Z({name:this.coinInfo.shortcut,worker:r,server:i,debug:e.debug,proxy:e.proxy})}onError(e){this.link.dispose(),this.postMessage(Gt(Ft,{coin:this.coinInfo,error:e.message,code:e.code})),this.onDisconnected?.()}async init(){this.link.on("connected",(async()=>{const e=await this.link.getInfo();this.serverInfo=e;const t="tXRP"===this.coinInfo.shortcut?"XRP":this.coinInfo.shortcut;e.shortcut.toLowerCase()===t.toLowerCase()?(this.onConnected?.(e.url),this.postMessage(Gt(qt,{coin:this.coinInfo,...e}))):this.onError(g("Backend_Invalid"))})),this.link.on("disconnected",(()=>{this.onError(g("Backend_Disconnected"))})),this.link.on("error",(e=>{this.onError(g("Backend_Error",e.message))}));try{await this.link.connect()}catch(e){throw this.onError(g("Backend_Error",e.message)),e}}getTransactions(e){return Zt.all(e.map((e=>this.link.getTransaction(e))))}getCurrentFiatRates(e){return this.link.getCurrentFiatRates(e)}getFiatRatesForTimestamps(e){return this.link.getFiatRatesForTimestamps(e)}getAccountBalanceHistory(e){return this.link.getAccountBalanceHistory(e)}getNetworkInfo(){return this.link.getInfo()}getAccountInfo(e){return this.link.getAccountInfo(e)}getAccountUtxo(e){return this.link.getAccountUtxo(e)}async estimateFee(e){const{blocks:t}=e;if(!e.specific&&Array.isArray(t)&&t.length>0){if((Date.now()-this.feeTimestamp>12e5?t:t.filter((e=>!this.feeForBlock[e]))).length<1)return t.map((e=>this.feeForBlock[e]));this.feeForBlock=[];const r=await this.link.estimateFee(e);return t.forEach(((e,t)=>{this.feeForBlock[e]=r[t]})),this.feeTimestamp=Date.now(),r}return this.link.estimateFee(e)}async subscribe(e){0===this.link.listenerCount("block")&&this.link.on("block",(e=>{this.postMessage(Gt(zt,{coin:this.coinInfo,...e}))})),0===this.link.listenerCount("notification")&&this.link.on("notification",(e=>{this.postMessage(Gt(Ht,{coin:this.coinInfo,notification:e}))}));const t=await this.link.subscribe({type:"block"});return e?this.link.subscribe({type:"accounts",accounts:e}):t}subscribeFiatRates(e){return 0===this.link.listenerCount("fiatRates")&&this.link.on("fiatRates",(({rates:e})=>{this.postMessage(Gt(Vt,{coin:this.coinInfo,rates:e}))})),this.link.subscribe({type:"fiatRates"})}async unsubscribe(e){return e?this.link.unsubscribe({type:"accounts",accounts:e}):(this.link.removeAllListeners("block"),this.link.removeAllListeners("fiatRates"),this.link.removeAllListeners("notification"),await this.link.unsubscribe({type:"fiatRates"}),this.link.unsubscribe({type:"block"}))}unsubscribeFiatRates(){return this.link.removeAllListeners("fiatRates"),this.link.unsubscribe({type:"fiatRates"})}pushTransaction(e){return this.link.pushTransaction(e)}disconnect(){this.link.removeAllListeners(),this.link.disconnect(),this.onError(g("Backend_Disconnected"))}}var Xt=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;const Jt=new class{instances={};custom={};preferred={};get(e){return this.instances[e]??null}remove(e){delete this.instances[e]}async getOrConnect(e,t){let r=this.get(e.shortcut);if(!r){r=new Yt({coinInfo:this.patchCoinInfo(e),postMessage:t,debug:he.getSettings("debug"),proxy:he.getSettings("proxy"),onConnected:t=>this.setPreferred(e.shortcut,t),onDisconnected:()=>this.remove(e.shortcut)}),this.instances[e.shortcut]=r;try{await r.init()}catch(t){throw this.remove(e.shortcut),this.removePreferred(e.shortcut),t}}return r}dispose(){Object.values(this.instances).forEach((e=>e.disconnect()))}reconnectAll(){const e=Object.values(this.instances).map((e=>[e.coinInfo,e.postMessage]));return Object.values(this.instances).forEach((e=>e.disconnect())),Xt.all(e.map((e=>this.getOrConnect(...e))))}isSupported(e){if(!(this.custom[e.shortcut]||e.blockchainLink))throw g("Backend_NotSupported")}setCustom(e,t){this.removePreferred(e),this.custom[e]=t}removeCustom(e){this.removePreferred(e),delete this.custom[e]}setPreferred(e,t){this.preferred[e]=t}removePreferred(e){delete this.preferred[e]}patchCoinInfo(e){const t=this.custom[e.shortcut],r=this.preferred[e.shortcut],i=r?[r]:t?.url??e.blockchainLink?.url;return{...e,blockchainLink:{...e.blockchainLink,...t,url:i}}}},Qt=e=>Jt.get(e),er=e=>Jt.isSupported(e),tr=(e,t)=>Jt.getOrConnect(e,t);var rr=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;class ir extends St{init(){this.requiredPermissions=[],this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"coin",type:"string",required:!0}]);const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");er(t),this.params={coinInfo:t}}get info(){return""}run(){const e=Qt(this.params.coinInfo.shortcut);return e&&e.disconnect(),rr.resolve({disconnected:!0})}}var nr=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,sr=Math.ceil,or=Math.floor,ar="[BigNumber Error] ",ur=ar+"Number primitive has more than 15 significant digits: ",hr=1e14,lr=14,dr=9007199254740991,cr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],fr=1e7,pr=1e9;function mr(e){var t=0|e;return e>0||e===t?t:t-1}function br(e){for(var t,r,i=1,n=e.length,s=e[0]+"";ih^r?1:-1;for(a=(u=n.length)<(h=s.length)?u:h,o=0;os[o]^r?1:-1;return u==h?0:u>h^r?1:-1}function yr(e,t,r,i){if(er||e!==or(e))throw Error(ar+(i||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function vr(e){var t=e.c.length-1;return mr(e.e/lr)==t&&e.c[t]%2!=0}function wr(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function _r(e,t,r){var i,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(++t>(i=e.length)){for(n=r,t-=i;--t;n+=r);e+=n}else tv?c.c=c.e=null:e.e=10;u/=10,a++);return void(a>v?c.c=c.e=null:(c.e=a,c.c=[e]))}d=String(e)}else{if(!nr.test(d=String(e)))return n(c,d,h);c.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(a=d.indexOf("."))>-1&&(d=d.replace(".","")),(u=d.search(/e/i))>0?(a<0&&(a=u),a+=+d.slice(u+1),d=d.substring(0,u)):a<0&&(a=d.length)}else{if(yr(t,2,S.length,"Base"),10==t&&T)return k(c=new I(e),p+c.e+1,m);if(d=String(e),h="number"==typeof e){if(0*e!=0)return n(c,d,h,t);if(c.s=1/e<0?(d=d.slice(1),-1):1,I.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(ur+e)}else c.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(r=S.slice(0,t),a=u=0,l=d.length;ua){a=l;continue}}else if(!o&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){o=!0,u=-1,a=0;continue}return n(c,String(e),h,t)}h=!1,(a=(d=i(d,t,10,c.s)).indexOf("."))>-1?d=d.replace(".",""):a=d.length}for(u=0;48===d.charCodeAt(u);u++);for(l=d.length;48===d.charCodeAt(--l););if(d=d.slice(u,++l)){if(l-=u,h&&I.DEBUG&&l>15&&(e>dr||e!==or(e)))throw Error(ur+c.s*e);if((a=a-u-1)>v)c.c=c.e=null;else if(a=g)?wr(u,o):_r(u,o,"0");else if(s=(e=k(new I(e),t,r)).e,a=(u=br(e.c)).length,1==i||2==i&&(t<=s||s<=b)){for(;aa){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=s-a)>0)for(s+1==a&&(u+=".");t--;u+="0");return e.s<0&&n?"-"+u:u}function A(e,t){for(var r,i=1,n=new I(e[0]);i=10;n/=10,i++);return(r=i+r*lr-1)>v?e.c=e.e=null:r=10;a/=10,n++);if((s=t-n)<0)s+=lr,o=t,l=(u=d[h=0])/c[n-o-1]%10|0;else if((h=sr((s+1)/lr))>=d.length){if(!i)break e;for(;d.length<=h;d.push(0));u=l=0,n=1,o=(s%=lr)-lr+1}else{for(u=a=d[h],n=1;a>=10;a/=10,n++);l=(o=(s%=lr)-lr+n)<0?0:u/c[n-o-1]%10|0}if(i=i||t<0||null!=d[h+1]||(o<0?u:u%c[n-o-1]),i=r<4?(l||i)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||i||6==r&&(s>0?o>0?u/c[n-o]:0:d[h-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,i?(t-=e.e+1,d[0]=c[(lr-t%lr)%lr],e.e=-t||0):d[0]=e.e=0,e;if(0==s?(d.length=h,a=1,h--):(d.length=h+1,a=c[lr-s],d[h]=o>0?or(u/c[n-o]%c[o])*a:0),i)for(;;){if(0==h){for(s=1,o=d[0];o>=10;o/=10,s++);for(o=d[0]+=a,a=1;o>=10;o/=10,a++);s!=a&&(e.e++,d[0]==hr&&(d[0]=1));break}if(d[h]+=a,d[h]!=hr)break;d[h--]=0,a=1}for(s=d.length;0===d[--s];d.pop());}e.e>v?e.c=e.e=null:e.e=g?wr(t,r):_r(t,r,"0"),e.s<0?"-"+t:t)}return I.clone=e,I.ROUND_UP=0,I.ROUND_DOWN=1,I.ROUND_CEIL=2,I.ROUND_FLOOR=3,I.ROUND_HALF_UP=4,I.ROUND_HALF_DOWN=5,I.ROUND_HALF_EVEN=6,I.ROUND_HALF_CEIL=7,I.ROUND_HALF_FLOOR=8,I.EUCLID=9,I.config=I.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(ar+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(yr(r=e[t],0,pr,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(yr(r=e[t],0,8,t),m=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(yr(r[0],-pr,0,t),yr(r[1],0,pr,t),b=r[0],g=r[1]):(yr(r,-pr,pr,t),b=-(g=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)yr(r[0],-pr,-1,t),yr(r[1],1,pr,t),y=r[0],v=r[1];else{if(yr(r,-pr,pr,t),!r)throw Error(ar+t+" cannot be zero: "+r);y=-(v=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(ar+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!r,Error(ar+"crypto unavailable");w=r}else w=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(yr(r=e[t],0,9,t),_=r),e.hasOwnProperty(t="POW_PRECISION")&&(yr(r=e[t],0,pr,t),M=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(ar+t+" not an object: "+r);E=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(ar+t+" invalid: "+r);T="0123456789"==r.slice(0,10),S=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:m,EXPONENTIAL_AT:[b,g],RANGE:[y,v],CRYPTO:w,MODULO_MODE:_,POW_PRECISION:M,FORMAT:E,ALPHABET:S}},I.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!I.DEBUG)return!0;var t,r,i=e.c,n=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(i)){if((1===s||-1===s)&&n>=-pr&&n<=pr&&n===or(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break e}if((t=(n+1)%lr)<1&&(t+=lr),String(i[0]).length==t){for(t=0;t=hr||r!==or(r))break e;if(0!==r)return!0}}}else if(null===i&&null===n&&(null===s||1===s||-1===s))return!0;throw Error(ar+"Invalid BigNumber: "+e)},I.maximum=I.max=function(){return A(arguments,c.lt)},I.minimum=I.min=function(){return A(arguments,c.gt)},I.random=(s=9007199254740992,o=Math.random()*s&2097151?function(){return or(Math.random()*s)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,s,a=0,u=[],h=new I(f);if(null==e?e=p:yr(e,0,pr),n=sr(e/lr),w)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(n*=2));a>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[a]=r[0],t[a+1]=r[1]):(u.push(s%1e14),a+=2);a=n/2}else{if(!crypto.randomBytes)throw w=!1,Error(ar+"crypto unavailable");for(t=crypto.randomBytes(n*=7);a=9e15?crypto.randomBytes(7).copy(t,a):(u.push(s%1e14),a+=7);a=n/7}if(!w)for(;a=10;s/=10,a++);ar-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}return function(i,n,s,o,a){var u,h,l,d,c,f,b,g,y=i.indexOf("."),v=p,w=m;for(y>=0&&(d=M,M=0,i=i.replace(".",""),f=(g=new I(n)).pow(i.length-y),M=d,g.c=t(_r(br(f.c),f.e,"0"),10,s,e),g.e=g.c.length),l=d=(b=t(i,n,s,a?(u=S,e):(u=e,S))).length;0==b[--d];b.pop());if(!b[0])return u.charAt(0);if(y<0?--l:(f.c=b,f.e=l,f.s=o,b=(f=r(f,g,v,w,s)).c,c=f.r,l=f.e),y=b[h=l+v+1],d=s/2,c=c||h<0||null!=b[h+1],c=w<4?(null!=y||c)&&(0==w||w==(f.s<0?3:2)):y>d||y==d&&(4==w||c||6==w&&1&b[h-1]||w==(f.s<0?8:7)),h<1||!b[0])i=c?_r(u.charAt(1),-v,u.charAt(0)):u.charAt(0);else{if(b.length=h,c)for(--s;++b[--h]>s;)b[h]=0,h||(++l,b=[1].concat(b));for(d=b.length;!b[--d];);for(y=0,i="";y<=d;i+=u.charAt(b[y++]));i=_r(i,l,u.charAt(0))}return i}}(),r=function(){function e(e,t,r){var i,n,s,o,a=0,u=e.length,h=t%fr,l=t/fr|0;for(e=e.slice();u--;)a=((n=h*(s=e[u]%fr)+(i=l*s+(o=e[u]/fr|0)*h)%fr*fr+a)/r|0)+(i/fr|0)+l*o,e[u]=n%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,i){var n,s;if(r!=i)s=r>i?1:-1;else for(n=s=0;nt[n]?1:-1;break}return s}function r(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r]1;e.splice(0,1));}return function(i,n,s,o,a){var u,h,l,d,c,f,p,m,b,g,y,v,w,_,M,E,S,T=i.s==n.s?1:-1,O=i.c,A=n.c;if(!(O&&O[0]&&A&&A[0]))return new I(i.s&&n.s&&(O?!A||O[0]!=A[0]:A)?O&&0==O[0]||!A?0*T:T/0:NaN);for(b=(m=new I(T)).c=[],T=s+(h=i.e-n.e)+1,a||(a=hr,h=mr(i.e/lr)-mr(n.e/lr),T=T/lr|0),l=0;A[l]==(O[l]||0);l++);if(A[l]>(O[l]||0)&&h--,T<0)b.push(1),d=!0;else{for(_=O.length,E=A.length,l=0,T+=2,(c=or(a/(A[0]+1)))>1&&(A=e(A,c,a),O=e(O,c,a),E=A.length,_=O.length),w=E,y=(g=O.slice(0,E)).length;y=a/2&&M++;do{if(c=0,(u=t(A,g,E,y))<0){if(v=g[0],E!=y&&(v=v*a+(g[1]||0)),(c=or(v/M))>1)for(c>=a&&(c=a-1),p=(f=e(A,c,a)).length,y=g.length;1==t(f,g,p,y);)c--,r(f,E=10;T/=10,l++);k(m,s+(m.e=l+h*lr-1)+1,o,d)}else m.e=h,m.r=+d;return m}}(),a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,h=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,d=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,i){var n,s=r?t:t.replace(d,"");if(l.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(a,(function(e,t,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=n?e:t})),i&&(n=i,s=s.replace(u,"$1").replace(h,"0.$1")),t!=s))return new I(s,n);if(I.DEBUG)throw Error(ar+"Not a"+(i?" base "+i:"")+" number: "+t);e.s=null}e.c=e.e=null},c.absoluteValue=c.abs=function(){var e=new I(this);return e.s<0&&(e.s=1),e},c.comparedTo=function(e,t){return gr(this,new I(e,t))},c.decimalPlaces=c.dp=function(e,t){var r,i,n,s=this;if(null!=e)return yr(e,0,pr),null==t?t=m:yr(t,0,8),k(new I(s),e+s.e+1,t);if(!(r=s.c))return null;if(i=((n=r.length-1)-mr(this.e/lr))*lr,n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},c.dividedBy=c.div=function(e,t){return r(this,new I(e,t),p,m)},c.dividedToIntegerBy=c.idiv=function(e,t){return r(this,new I(e,t),0,1)},c.exponentiatedBy=c.pow=function(e,t){var r,i,n,s,o,a,u,h,l=this;if((e=new I(e)).c&&!e.isInteger())throw Error(ar+"Exponent not an integer: "+x(e));if(null!=t&&(t=new I(t)),o=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return h=new I(Math.pow(+x(l),o?e.s*(2-vr(e)):+x(e))),t?h.mod(t):h;if(a=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new I(NaN);(i=!a&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||o&&l.c[1]>=24e7:l.c[0]<8e13||o&&l.c[0]<=9999975e7)))return s=l.s<0&&vr(e)?-0:0,l.e>-1&&(s=1/s),new I(a?1/s:s);M&&(s=sr(M/lr+2))}for(o?(r=new I(.5),a&&(e.s=1),u=vr(e)):u=(n=Math.abs(+x(e)))%2,h=new I(f);;){if(u){if(!(h=h.times(l)).c)break;s?h.c.length>s&&(h.c.length=s):i&&(h=h.mod(t))}if(n){if(0===(n=or(n/2)))break;u=n%2}else if(k(e=e.times(r),e.e+1,1),e.e>14)u=vr(e);else{if(0===(n=+x(e)))break;u=n%2}l=l.times(l),s?l.c&&l.c.length>s&&(l.c.length=s):i&&(l=l.mod(t))}return i?h:(a&&(h=f.div(h)),t?h.mod(t):s?k(h,M,m,undefined):h)},c.integerValue=function(e){var t=new I(this);return null==e?e=m:yr(e,0,8),k(t,t.e+1,e)},c.isEqualTo=c.eq=function(e,t){return 0===gr(this,new I(e,t))},c.isFinite=function(){return!!this.c},c.isGreaterThan=c.gt=function(e,t){return gr(this,new I(e,t))>0},c.isGreaterThanOrEqualTo=c.gte=function(e,t){return 1===(t=gr(this,new I(e,t)))||0===t},c.isInteger=function(){return!!this.c&&mr(this.e/lr)>this.c.length-2},c.isLessThan=c.lt=function(e,t){return gr(this,new I(e,t))<0},c.isLessThanOrEqualTo=c.lte=function(e,t){return-1===(t=gr(this,new I(e,t)))||0===t},c.isNaN=function(){return!this.s},c.isNegative=function(){return this.s<0},c.isPositive=function(){return this.s>0},c.isZero=function(){return!!this.c&&0==this.c[0]},c.minus=function(e,t){var r,i,n,s,o=this,a=o.s;if(t=(e=new I(e,t)).s,!a||!t)return new I(NaN);if(a!=t)return e.s=-t,o.plus(e);var u=o.e/lr,h=e.e/lr,l=o.c,d=e.c;if(!u||!h){if(!l||!d)return l?(e.s=-t,e):new I(d?o:NaN);if(!l[0]||!d[0])return d[0]?(e.s=-t,e):new I(l[0]?o:3==m?-0:0)}if(u=mr(u),h=mr(h),l=l.slice(),a=u-h){for((s=a<0)?(a=-a,n=l):(h=u,n=d),n.reverse(),t=a;t--;n.push(0));n.reverse()}else for(i=(s=(a=l.length)<(t=d.length))?a:t,a=t=0;t0)for(;t--;l[r++]=0);for(t=hr-1;i>a;){if(l[--i]=0;){for(r=0,c=v[n]%b,f=v[n]/b|0,s=n+(o=u);s>n;)r=((h=c*(h=y[--o]%b)+(a=f*h+(l=y[o]/b|0)*c)%b*b+p[s]+r)/m|0)+(a/b|0)+f*l,p[s--]=h%m;p[s]=r}return r?++i:p.splice(0,1),j(e,p,i)},c.negated=function(){var e=new I(this);return e.s=-e.s||null,e},c.plus=function(e,t){var r,i=this,n=i.s;if(t=(e=new I(e,t)).s,!n||!t)return new I(NaN);if(n!=t)return e.s=-t,i.minus(e);var s=i.e/lr,o=e.e/lr,a=i.c,u=e.c;if(!s||!o){if(!a||!u)return new I(n/0);if(!a[0]||!u[0])return u[0]?e:new I(a[0]?i:0*n)}if(s=mr(s),o=mr(o),a=a.slice(),n=s-o){for(n>0?(o=s,r=u):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=n),n=0;t;)n=(a[--t]=a[t]+u[t]+n)/hr|0,a[t]=hr===a[t]?0:a[t]%hr;return n&&(a=[n].concat(a),++o),j(e,a,o)},c.precision=c.sd=function(e,t){var r,i,n,s=this;if(null!=e&&e!==!!e)return yr(e,1,pr),null==t?t=m:yr(t,0,8),k(new I(s),e,t);if(!(r=s.c))return null;if(i=(n=r.length-1)*lr+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return e&&s.e+1>i&&(i=s.e+1),i},c.shiftedBy=function(e){return yr(e,-9007199254740991,dr),this.times("1e"+e)},c.squareRoot=c.sqrt=function(){var e,t,i,n,s,o=this,a=o.c,u=o.s,h=o.e,l=p+4,d=new I("0.5");if(1!==u||!a||!a[0])return new I(!u||u<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(u=Math.sqrt(+x(o)))||u==1/0?(((t=br(a)).length+h)%2==0&&(t+="0"),u=Math.sqrt(+t),h=mr((h+1)/2)-(h<0||h%2),i=new I(t=u==1/0?"5e"+h:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+h)):i=new I(u+""),i.c[0])for((u=(h=i.e)+l)<3&&(u=0);;)if(s=i,i=d.times(s.plus(r(o,s,l,1))),br(s.c).slice(0,u)===(t=br(i.c)).slice(0,u)){if(i.e0&&p>0){for(s=p%a||a,l=f.substr(0,s);s0&&(l+=h+f.slice(s)),c&&(l="-"+l)}i=d?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):l}return(r.prefix||"")+i+(r.suffix||"")},c.toFraction=function(e){var t,i,n,s,o,a,u,h,l,d,c,p,b=this,g=b.c;if(null!=e&&(!(u=new I(e)).isInteger()&&(u.c||1!==u.s)||u.lt(f)))throw Error(ar+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+x(u));if(!g)return new I(b);for(t=new I(f),l=i=new I(f),n=h=new I(f),p=br(g),o=t.e=p.length-b.e-1,t.c[0]=cr[(a=o%lr)<0?lr+a:a],e=!e||u.comparedTo(t)>0?o>0?t:l:u,a=v,v=1/0,u=new I(p),h.c[0]=0;d=r(u,t,0,1),1!=(s=i.plus(d.times(n))).comparedTo(e);)i=n,n=s,l=h.plus(d.times(s=l)),h=s,t=u.minus(d.times(s=t)),u=s;return s=r(e.minus(i),n,0,1),h=h.plus(s.times(l)),i=i.plus(s.times(n)),h.s=l.s=b.s,c=r(l,n,o*=2,m).minus(b).abs().comparedTo(r(h,i,o,m).minus(b).abs())<1?[l,n]:[h,i],v=a,c},c.toNumber=function(){return+x(this)},c.toPrecision=function(e,t){return null!=e&&yr(e,1,pr),O(this,e,t,2)},c.toString=function(e){var t,r=this,n=r.s,s=r.e;return null===s?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=s<=b||s>=g?wr(br(r.c),s):_r(br(r.c),s,"0"):10===e&&T?t=_r(br((r=k(new I(r),p+s+1,m)).c),r.e,"0"):(yr(e,2,S.length,"Base"),t=i(_r(br(r.c),s,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},c.valueOf=c.toJSON=function(){return x(this)},c._isBigNumber=!0,c[Symbol.toStringTag]="BigNumber",c[Symbol.for("nodejs.util.inspect.custom")]=c.valueOf,null!=t&&I.set(t),I}();const Er=Mr,Sr=(e,t,r)=>{const i=[];for(let n=e+t;n<=e+r;n+=t)i.push(n);return i};class Tr{blocks=[];constructor(e){this.coinInfo=e,this.levels=e.defaultFees}async loadMisc(e){try{const[t]=await e.estimateFee({blocks:[1]});this.levels[0]={...this.levels[0],...t,feePerUnit:Math.min(this.coinInfo.maxFee,Math.max(this.coinInfo.minFee,parseInt(t.feePerUnit,10))).toString()}}catch(e){}return this.levels}async load(e){if("bitcoin"!==this.coinInfo.type)return this.loadMisc(e);let t=Sr(0,1,10);this.levels.length>1&&(t=this.levels.map((e=>e.blocks)).reduce(((e,t)=>{if(0===e.length)return e.concat([t]);const r=e[e.length-1],i=t-r,n=Sr(r,i<=30?1:6,i);return e.concat(n)}),[]));t.push(...Sr(144,72,864));try{(await e.estimateFee({blocks:t})).forEach((({feePerUnit:e},r)=>{this.blocks[t[r]]=((e,t)=>{const r=new Er(e);if(r.isNaN()||r.lte("0"))return;const i=r.div(1e3);return i.lt(t)?t.toString():i.isInteger()?i.toString():i.toFixed(2)})(e,this.coinInfo.minFee)})),this.levels.forEach((e=>{const t=((e,t)=>{if("string"==typeof t[e])return t[e];const r=t.length;let i=e;for(;"string"!=typeof t[i]&&i0;)i--;return t[i]})(e.blocks,this.blocks);"string"==typeof t&&(e.blocks=this.blocks.indexOf(t),e.feePerUnit=t)})),this.longTermFeeRate=(e=>e.slice(0).reverse().find((e=>"string"==typeof e)))(this.blocks)}catch(e){}return this.levels}updateCustomFee(e){this.levels=this.levels.filter((e=>"custom"!==e.label));const t=((e,t)=>{const r=new Er(e),i=t.find((e=>"string"==typeof e&&r.gte(e)));return i?t.indexOf(i):-1})(e,this.blocks);this.levels.push({label:"custom",feePerUnit:e,blocks:t})}}class Ir extends St{init(){this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"coin",type:"string",required:!0},{name:"request",type:"object"}]);const{request:t}=e;t&&(It(t,[{name:"blocks",type:"array"},{name:"specific",type:"object"},{name:"feeLevels",type:"string"}]),t.specific&&It(t.specific,[{name:"conservative",type:"boolean"},{name:"data",type:"string"},{name:"from",type:"string"},{name:"to",type:"string"},{name:"txsize",type:"number"}]));const r=V(e.coin);if(!r)throw g("Method_UnknownCoin");er(r),this.params={coinInfo:r,request:t}}async run(){const{coinInfo:e,request:t}=this.params,r={blockTime:e.blockTime,minFee:e.minFee,maxFee:e.maxFee,dustLimit:"bitcoin"===e.type?e.dustLimit:void 0,levels:[]};if(t&&t.feeLevels){const i=new Tr(e);if("smart"===t.feeLevels&&"DOGE"!==e.shortcut){const t=await tr(e,this.postMessage);await i.load(t)}r.levels=i.levels}else{const i=await tr(e,this.postMessage);r.levels=await i.estimateFee(t||{})}return r}}class Or extends St{init(){this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"coin",type:"string",required:!0},{name:"descriptor",type:"string",required:!0},{name:"from",type:"number"},{name:"to",type:"number"},{name:"groupBy",type:"number"}]);const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");er(t),this.params={coinInfo:t,request:{descriptor:e.descriptor,from:e.from,to:e.to,groupBy:e.groupBy}}}async run(){return(await tr(this.params.coinInfo,this.postMessage)).getAccountBalanceHistory(this.params.request)}}class Ar extends St{init(){this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"currencies",type:"array",required:!1},{name:"token",type:"string"},{name:"coin",type:"string",required:!0}]);const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");er(t),this.params={currencies:e.currencies,token:e.token,coinInfo:t}}async run(){return(await tr(this.params.coinInfo,this.postMessage)).getCurrentFiatRates({currencies:this.params.currencies,token:this.params.token})}}class jr extends St{init(){this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"currencies",type:"array",required:!1},{name:"timestamps",type:"array",required:!0},{name:"token",type:"string"},{name:"coin",type:"string",required:!0}]);const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");er(t),this.params={currencies:e.currencies,timestamps:e.timestamps,token:e.token,coinInfo:t}}async run(){return(await tr(this.params.coinInfo,this.postMessage)).getFiatRatesForTimestamps({currencies:this.params.currencies,timestamps:this.params.timestamps,token:this.params.token})}}class kr extends St{init(){this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"txs",type:"array",required:!0},{name:"coin",type:"string",required:!0}]);const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");er(t),this.params={txs:e.txs,coinInfo:t}}async run(){return(await tr(this.params.coinInfo,this.postMessage)).getTransactions(this.params.txs)}}class xr extends St{init(){this.requiredPermissions=[],this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"coin",type:"string",required:!0},{name:"blockchainLink",type:"object"}]);const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");((e,t)=>{t?.url.length?Jt.setCustom(e.shortcut,t):Jt.removeCustom(e.shortcut)})(t,e.blockchainLink),this.params={coinInfo:t}}get info(){return""}async run(){const e=Qt(this.params.coinInfo.shortcut);return e&&(e.disconnect(),await tr(this.params.coinInfo,this.postMessage)),!0}}class Rr extends St{init(){this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"accounts",type:"array",allowEmpty:!0},{name:"coin",type:"string",required:!0}]),e.accounts&&e.accounts.forEach((e=>{It(e,[{name:"descriptor",type:"string",required:!0}])}));const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");er(t),this.params={accounts:e.accounts,coinInfo:t}}async run(){return(await tr(this.params.coinInfo,this.postMessage)).subscribe(this.params.accounts)}}class Pr extends St{init(){this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"currency",type:"string",required:!1},{name:"coin",type:"string",required:!0}]);const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");er(t),this.params={currency:e.currency,coinInfo:t}}async run(){return(await tr(this.params.coinInfo,this.postMessage)).subscribeFiatRates(this.params.currency)}}class Nr extends St{init(){this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"accounts",type:"array",allowEmpty:!0},{name:"coin",type:"string",required:!0}]),e.accounts&&e.accounts.forEach((e=>{It(e,[{name:"descriptor",type:"string",required:!0}])}));const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");er(t),this.params={accounts:e.accounts,coinInfo:t}}async run(){return(await tr(this.params.coinInfo,this.postMessage)).unsubscribe(this.params.accounts)}}class Cr extends St{init(){this.useDevice=!1,this.useUi=!1;const{payload:e}=this;It(e,[{name:"coin",type:"string",required:!0}]);const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");er(t),this.params={coinInfo:t}}async run(){return(await tr(this.params.coinInfo,this.postMessage)).unsubscribeFiatRates()}}const Br=e=>{It(e,[{name:"addressType",type:"number",required:!0},{name:"stakingKeyHash",type:"string"},{name:"paymentScriptHash",type:"string"},{name:"stakingScriptHash",type:"string"}]),e.path&&x(e.path),e.stakingPath&&x(e.stakingPath),e.certificatePointer&&It(e.certificatePointer,[{name:"blockIndex",type:"number",required:!0},{name:"txIndex",type:"number",required:!0},{name:"certificateIndex",type:"number",required:!0}])},Ur=(e,t)=>{if(t.address_type===Je.CardanoAddressType.REWARD){let{address_n:r,address_n_staking:i}=t;if(r.length>0&&i.length>0)throw g("Method_InvalidParameter","Only stakingPath is allowed for CardanoAddressType.REWARD");return e.atLeast(["0","2.4.3"])?r.length>0&&(i=r,r=[]):i.length>0&&(r=i,i=[]),{...t,address_n:r,address_n_staking:i}}return t},Dr=e=>{let t=[];e.path&&(t=x(e.path,3));let r,i=[];return e.stakingPath&&(i=x(e.stakingPath,3)),e.certificatePointer&&(r={block_index:e.certificatePointer.blockIndex,tx_index:e.certificatePointer.txIndex,certificate_index:e.certificatePointer.certificateIndex}),{address_type:e.addressType,address_n:t,address_n_staking:i,staking_key_hash:e.stakingKeyHash,certificate_pointer:r,script_payment_hash:e.paymentScriptHash,script_staking_hash:e.stakingScriptHash}},Lr=e=>{let t;return e.certificate_pointer&&(t={blockIndex:e.certificate_pointer.block_index,txIndex:e.certificate_pointer.tx_index,certificateIndex:e.certificate_pointer.certificate_index}),{addressType:e.address_type,path:e.address_n,stakingPath:e.address_n_staking,stakingKeyHash:e.staking_key_hash,certificatePointer:t}};class qr extends St{progress=0;init(){this.requiredPermissions=["read"],this.firmwareRange=At(this.name,q("Cardano"),this.firmwareRange),this.hasBundle=!!this.payload.bundle;const e=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};It(e,[{name:"bundle",type:"array"},{name:"useEventListener",type:"boolean"}]),this.params=e.bundle.map((e=>(It(e,[{name:"addressParameters",type:"object",required:!0},{name:"networkId",type:"number",required:!0},{name:"protocolMagic",type:"number",required:!0},{name:"derivationType",type:"number"},{name:"address",type:"string"},{name:"showOnTrezor",type:"boolean"}]),Br(e.addressParameters),{address_parameters:Dr(e.addressParameters),address:e.address,protocol_magic:e.protocolMagic,network_id:e.networkId,derivation_type:void 0!==e.derivationType?e.derivationType:Je.CardanoDerivationType.ICARUS_TREZOR,show_display:"boolean"!=typeof e.showOnTrezor||e.showOnTrezor})));const t=e.useEventListener&&1===this.params.length&&"string"==typeof this.params[0].address&&this.params[0].show_display;this.confirmed=t,this.useUi=!t}get info(){return 1===this.params.length?`Export Cardano address for account #${_(this.params[0].address_parameters.address_n[2])+1}`:"Export multiple Cardano addresses"}getButtonRequestData(e){if("ButtonRequest_Address"===e)return{type:"address",serializedPath:R(this.params[this.progress].address_parameters.address_n),address:this.params[this.progress].address||"not-set"}}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:this.info}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async noBackupConfirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await e.promise).payload}async _call({address_parameters:e,protocol_magic:t,network_id:r,derivation_type:i,show_display:n}){const s=this.device.getCommands();return(await s.typedCall("CardanoGetAddress","CardanoAddress",{address_parameters:e,protocol_magic:t,network_id:r,derivation_type:i,show_display:n})).message}_ensureFirmwareSupportsBatch(e){if([Je.CardanoAddressType.BASE_SCRIPT_KEY,Je.CardanoAddressType.BASE_KEY_SCRIPT,Je.CardanoAddressType.BASE_SCRIPT_SCRIPT,Je.CardanoAddressType.POINTER_SCRIPT,Je.CardanoAddressType.ENTERPRISE_SCRIPT,Je.CardanoAddressType.REWARD_SCRIPT].includes(e.address_parameters.address_type)&&!this.device.atLeast(["0","2.4.3"]))throw g("Method_InvalidParameter","Address type not supported by device firmware")}async run(){const e=[];for(let t=0;t{this.validateScript(e)}))}scriptToProto(e){let t=[];e.scripts&&(t=e.scripts.map((e=>this.scriptToProto(e))));let r=[];return e.keyPath&&(r=x(e.keyPath,3)),{type:e.type,scripts:t,key_hash:e.keyHash,key_path:r,required_signatures_count:e.requiredSignaturesCount,invalid_before:e.invalidBefore,invalid_hereafter:e.invalidHereafter}}async run(){const{message:e}=await this.device.getCommands().typedCall("CardanoGetNativeScriptHash","CardanoNativeScriptHash",{script:this.params.script,display_format:this.params.display_format,derivation_type:this.params.derivation_type});return{scriptHash:e.script_hash}}}class zr extends St{init(){this.requiredPermissions=["read"],this.firmwareRange=At(this.name,q("Cardano"),this.firmwareRange),this.hasBundle=!!this.payload.bundle;const e=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};It(e,[{name:"bundle",type:"array"}]),this.params=e.bundle.map((e=>{It(e,[{name:"path",required:!0},{name:"derivationType",type:"number"},{name:"showOnTrezor",type:"boolean"},{name:"suppressBackupWarning",type:"boolean"}]);return{address_n:x(e.path,3),derivation_type:void 0!==e.derivationType?e.derivationType:Je.CardanoDerivationType.ICARUS_TREZOR,show_display:"boolean"==typeof e.showOnTrezor&&e.showOnTrezor,suppress_backup_warning:e.suppressBackupWarning}}))}get info(){return"Export Cardano public key"}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);let t;t=this.params.length>1?"Export multiple Cardano public keys":`Export Cardano public key for account #${_(this.params[0].address_n[2])+1}`,this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-xpub",label:t}));const r=await e.promise;return this.confirmed=r.payload,this.confirmed}async noBackupConfirmation(e){if(e&&this.params.every((e=>e.suppressBackupWarning||!e.show_display)))return!0;await this.getPopupPromise().promise;const t=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await t.promise).payload}async run(){const e=[],t=this.device.getCommands();for(let r=0;r(e.votingPublicKey&&(console.warn("Please use votePublicKey instead of votingPublicKey."),e.votePublicKey=e.votingPublicKey),It(e,[{name:"votePublicKey",type:"string",required:!0},{name:"weight",type:"uint",required:!0}]),{vote_public_key:e.votePublicKey,weight:e.weight}),Vr=e=>{let t;return It(e,[{name:"hash",type:"string"}]),e.cVoteRegistrationParameters&&(t=(e=>{e.votingPublicKey&&(console.warn("Please use votePublicKey instead of votingPublicKey."),e.votePublicKey=e.votingPublicKey),e.rewardAddressParameters&&(console.warn("Please use paymentAddressParameters instead of rewardAddressParameters."),e.paymentAddressParameters=e.rewardAddressParameters),It(e,[{name:"votePublicKey",type:"string"},{name:"stakingPath",required:!0},{name:"nonce",type:"uint",required:!0},{name:"format",type:"number"},{name:"delegations",type:"array",allowEmpty:!0},{name:"votingPurpose",type:"uint"},{name:"address",type:"string"}]);const{paymentAddressParameters:t}=e;t&&Br(t);const{delegations:r}=e;if(r&&r.length>32)throw g("Method_InvalidParameter","At most 32 delegations are allowed in a CIP-36 registration");return{vote_public_key:e.votePublicKey,staking_path:x(e.stakingPath,3),payment_address_parameters:t?Dr(t):void 0,nonce:e.nonce,format:e.format,delegations:r?.map(Hr),voting_purpose:e.votingPurpose,payment_address:e.paymentAddress}})(e.cVoteRegistrationParameters)),{hash:e.hash,cvote_registration_parameters:t}};var Gr=__webpack_require__("../../node_modules/buffer/index.js").Buffer;const Wr=e=>{if(It(e,[{name:"type",type:"number",required:!0}]),e.type===Je.CardanoPoolRelayType.SINGLE_HOST_IP){const t=[{name:"port",type:"number",required:!0}];if(e.ipv4Address&&t.push({name:"ipv4Address",type:"string",required:!1}),e.ipv6Address&&t.push({name:"ipv6Address",type:"string",required:!1}),It(e,t),!e.ipv4Address&&!e.ipv6Address)throw g("Method_InvalidParameter","Either ipv4Address or ipv6Address must be supplied")}else e.type===Je.CardanoPoolRelayType.SINGLE_HOST_NAME?It(e,[{name:"hostName",type:"string",required:!0},{name:"port",type:"number",required:!0}]):e.type===Je.CardanoPoolRelayType.MULTIPLE_HOST_NAME&&It(e,[{name:"hostName",type:"string",required:!0}])},Kr=e=>{It(e,[{name:"poolId",type:"string",required:!0},{name:"vrfKeyHash",type:"string",required:!0},{name:"pledge",type:"string",required:!0},{name:"cost",type:"string",required:!0},{name:"margin",type:"object",required:!0},{name:"rewardAccount",type:"string",required:!0},{name:"owners",type:"array",required:!0},{name:"relays",type:"array",required:!0,allowEmpty:!0},{name:"metadata",type:"object"}]),It(e.margin,[{name:"numerator",type:"string",required:!0},{name:"denominator",type:"string",required:!0}]),(e=>{if(e.forEach((e=>{if(e.stakingKeyHash&&It(e,[{name:"stakingKeyHash",type:"string",required:!e.stakingKeyPath}]),e.stakingKeyPath&&x(e.stakingKeyPath,5),!e.stakingKeyHash&&!e.stakingKeyPath)throw g("Method_InvalidParameter","Either stakingKeyHash or stakingKeyPath must be supplied")})),1!==e.filter((e=>!!e.stakingKeyPath)).length)throw g("Method_InvalidParameter","Exactly one pool owner must be given as a path")})(e.owners),e.relays.forEach(Wr),e.metadata&&It(e.metadata,[{name:"url",type:"string",required:!0},{name:"hash",type:"string",required:!0}])},$r=e=>{const t=[{name:"type",type:"number",required:!0}];e.type!==Je.CardanoCertificateType.STAKE_POOL_REGISTRATION&&(t.push({name:"scriptHash",type:"string"}),t.push({name:"keyHash",type:"string"})),e.type===Je.CardanoCertificateType.STAKE_DELEGATION&&t.push({name:"pool",type:"string",required:!0}),e.type===Je.CardanoCertificateType.STAKE_POOL_REGISTRATION&&t.push({name:"poolParameters",type:"object",required:!0}),It(e,t);const{poolParameters:r,poolOwners:i,poolRelays:n}=(e=>e?(Kr(e),{poolParameters:{pool_id:e.poolId,vrf_key_hash:e.vrfKeyHash,pledge:e.pledge,cost:e.cost,margin_numerator:e.margin.numerator,margin_denominator:e.margin.denominator,reward_account:e.rewardAccount,metadata:e.metadata,owners_count:e.owners.length,relays_count:e.relays.length},poolOwners:e.owners.map((e=>({staking_key_hash:e.stakingKeyHash,staking_key_path:e.stakingKeyPath?x(e.stakingKeyPath,5):void 0}))),poolRelays:e.relays.map((e=>{return{type:e.type,ipv4_address:e.ipv4Address?(r=e.ipv4Address,Gr.from(r.split(".").map((e=>parseInt(e,10)))).toString("hex")):void 0,ipv6_address:e.ipv6Address?(t=e.ipv6Address,t.split(":").join("")):void 0,host_name:e.hostName,port:e.port};var t,r}))}):{poolParameters:void 0,poolOwners:[],poolRelays:[]})(e.poolParameters);return{certificate:{type:e.type,path:e.path?x(e.path,5):void 0,script_hash:e.scriptHash,key_hash:e.keyHash,pool:e.pool,pool_parameters:r},poolOwners:i,poolRelays:n}},Zr=e=>(It(e,[{name:"prev_hash",type:"string",required:!0},{name:"prev_index",type:"number",required:!0}]),{input:{prev_hash:e.prev_hash,prev_index:e.prev_index},path:e.path?x(e.path,5):void 0}),Yr=e=>(It(e,[{name:"prev_hash",type:"string",required:!0},{name:"prev_index",type:"number",required:!0}]),{collateralInput:{prev_hash:e.prev_hash,prev_index:e.prev_index},path:e.path?x(e.path,5):void 0}),Xr=e=>(It(e,[{name:"prev_hash",type:"string",required:!0},{name:"prev_index",type:"number",required:!0}]),{prev_hash:e.prev_hash,prev_index:e.prev_index}),Jr=e=>{e.forEach((e=>{It(e,[{name:"policyId",type:"string",required:!0},{name:"tokenAmounts",type:"array",required:!0}]),e.tokenAmounts.forEach((e=>{It(e,[{name:"assetNameBytes",type:"string",required:!0},{name:"amount",type:"uint"},{name:"mintAmount",type:"uint",allowNegative:!0}])}))}))},Qr=e=>(Jr(e),e.map((e=>{return{policyId:e.policyId,tokens:(t=e.tokenAmounts,t.map((e=>({asset_name_bytes:e.assetNameBytes,amount:e.amount,mint_amount:e.mintAmount}))))};var t}))),ei=e=>e.length/2,ti=async(e,t,r,i)=>{let n=0;for(;n{It(e,[{name:"address",type:"string"},{name:"amount",type:"uint",required:!0},{name:"tokenBundle",type:"array",allowEmpty:!0},{name:"datumHash",type:"string"},{name:"format",type:"number"},{name:"inlineDatum",type:"string"},{name:"referenceScript",type:"string"}]);const t={output:{amount:e.amount,asset_groups_count:0,datum_hash:e.datumHash,format:e.format,inline_datum_size:e.inlineDatum?ei(e.inlineDatum):void 0,reference_script_size:e.referenceScript?ei(e.referenceScript):void 0},inlineDatum:e.inlineDatum,referenceScript:e.referenceScript};return e.addressParameters?(Br(e.addressParameters),t.output.address_parameters=Dr(e.addressParameters)):t.output.address=e.address,e.tokenBundle?(t.tokenBundle=Qr(e.tokenBundle),t.output.asset_groups_count=t.tokenBundle.length):t.output.asset_groups_count=0,t},ii=async(e,t)=>{const{output:r,tokenBundle:i,inlineDatum:n,referenceScript:s}=t;if(await e("CardanoTxOutput","CardanoTxItemAck",r),i)for(const t of i){await e("CardanoAssetGroup","CardanoTxItemAck",{policy_id:t.policyId,tokens_count:t.tokens.length});for(const r of t.tokens)await e("CardanoToken","CardanoTxItemAck",r)}n&&await ti(e,n,2048,"CardanoTxInlineDatumChunk"),s&&await ti(e,s,2048,"CardanoTxReferenceScriptChunk")},ni=(e,t,r,i,n,s,o)=>{const a=new Map;function u(e){const t=JSON.stringify(e);a.set(t,e)}return o!==Je.CardanoTxSigningMode.MULTISIG_TRANSACTION&&(e.forEach((({path:e})=>{e&&u(e)})),t.forEach((({certificate:e,poolOwners:t})=>{!e.path||e.type!==Je.CardanoCertificateType.STAKE_DELEGATION&&e.type!==Je.CardanoCertificateType.STAKE_DEREGISTRATION||u(e.path),t.forEach((e=>{e.staking_key_path&&u(e.staking_key_path)}))})),r.forEach((({path:e})=>{e&&u(e)}))),o===Je.CardanoTxSigningMode.PLUTUS_TRANSACTION&&i.forEach((({path:e})=>{e&&u(e)})),n.forEach((({key_path:e})=>{e&&u(e)})),s.forEach((e=>{u(e)})),Array.from(a.values())},si=Object.freeze({TransactionStreaming:["0","2.4.2"],TokenMinting:["0","2.4.3"],Multisig:["0","2.4.3"],NetworkIdInTxBody:["0","2.4.4"],OutputDatumHash:["0","2.4.4"],ScriptDataHash:["0","2.4.4"],Plutus:["0","2.4.4"],KeyHashStakeCredential:["0","2.4.4"],Babbage:["0","2.5.2"],CIP36Registration:["0","2.5.3"],CIP36RegistrationExternalPaymentAddress:["0","2.5.4"]});class oi extends St{init(){this.requiredPermissions=["read","write"],this.firmwareRange=At(this.name,q("Cardano"),this.firmwareRange);const{payload:e}=this;if(e.metadata)throw g("Method_InvalidParameter","Metadata field has been replaced by auxiliaryData.");if(e.auxiliaryData&&e.auxiliaryData.blob)throw g("Method_InvalidParameter","Auxiliary data can now only be sent as a hash.");e.auxiliaryData&&e.auxiliaryData.catalystRegistrationParameters&&(console.warn("Please use cVoteRegistrationParameters instead of catalystRegistrationParameters."),e.auxiliaryData.cVoteRegistrationParameters=e.auxiliaryData.catalystRegistrationParameters),e.auxiliaryData&&e.auxiliaryData.governanceRegistrationParameters&&(console.warn("Please use cVoteRegistrationParameters instead of governanceRegistrationParameters."),e.auxiliaryData.cVoteRegistrationParameters=e.auxiliaryData.governanceRegistrationParameters),It(e,[{name:"signingMode",type:"number",required:!0},{name:"inputs",type:"array",required:!0},{name:"outputs",type:"array",required:!0,allowEmpty:!0},{name:"fee",type:"uint",required:!0},{name:"ttl",type:"uint"},{name:"certificates",type:"array",allowEmpty:!0},{name:"withdrawals",type:"array",allowEmpty:!0},{name:"mint",type:"array",allowEmpty:!0},{name:"validityIntervalStart",type:"uint"},{name:"scriptDataHash",type:"string"},{name:"collateralInputs",type:"array",allowEmpty:!0},{name:"requiredSigners",type:"array",allowEmpty:!0},{name:"totalCollateral",type:"uint"},{name:"referenceInputs",type:"array",allowEmpty:!0},{name:"protocolMagic",type:"number",required:!0},{name:"networkId",type:"number",required:!0},{name:"additionalWitnessRequests",type:"array",allowEmpty:!0},{name:"derivationType",type:"number"},{name:"includeNetworkId",type:"boolean"}]);const t=e.inputs.map(Zr),r=e.outputs.map(ri);let i=[];e.certificates&&(i=e.certificates.map($r));let n=[];e.withdrawals&&(n=e.withdrawals.map((e=>(It(e,[{name:"amount",type:"uint",required:!0},{name:"scriptHash",type:"string"},{name:"keyHash",type:"string"}]),{path:e.path?x(e.path,5):void 0,amount:e.amount,script_hash:e.scriptHash,key_hash:e.keyHash}))));let s,o=[];e.mint&&(o=Qr(e.mint)),e.auxiliaryData&&(s=Vr(e.auxiliaryData));let a=[];e.additionalWitnessRequests&&(a=e.additionalWitnessRequests.map((e=>x(e,3))));let u=[];e.collateralInputs&&(u=e.collateralInputs.map(Yr));let h=[];e.requiredSigners&&(h=e.requiredSigners.map((e=>(It(e,[{name:"keyHash",type:"string"}]),{key_path:e.keyPath?x(e.keyPath,3):void 0,key_hash:e.keyHash}))));const l=e.collateralReturn?ri(e.collateralReturn):void 0;let d=[];e.referenceInputs&&(d=e.referenceInputs.map(Xr)),this.params={signingMode:e.signingMode,inputsWithPath:t,outputsWithData:r,fee:e.fee,ttl:e.ttl,certificatesWithPoolOwnersAndRelays:i,withdrawals:n,mint:o,auxiliaryData:s,validityIntervalStart:e.validityIntervalStart,scriptDataHash:e.scriptDataHash,collateralInputsWithPath:u,requiredSigners:h,collateralReturnWithData:l,totalCollateral:e.totalCollateral,referenceInputs:d,protocolMagic:e.protocolMagic,networkId:e.networkId,witnessPaths:ni(t,i,n,u,h,a,e.signingMode),additionalWitnessRequests:a,derivationType:void 0!==e.derivationType?e.derivationType:Je.CardanoDerivationType.ICARUS_TREZOR,includeNetworkId:e.includeNetworkId}}get info(){return"Sign Cardano transaction"}_isFeatureSupported(e){return this.device.atLeast(si[e])}_ensureFeatureIsSupported(e){if(!this._isFeatureSupported(e))throw g("Method_InvalidParameter",`Feature ${e} not supported by device firmware`)}_ensureFirmwareSupportsParams(){const{params:e}=this;if(this._ensureFeatureIsSupported("TransactionStreaming"),e.certificatesWithPoolOwnersAndRelays.forEach((({certificate:e})=>{e.key_hash&&this._ensureFeatureIsSupported("KeyHashStakeCredential")})),e.outputsWithData.forEach((({output:e})=>{e.datum_hash&&this._ensureFeatureIsSupported("OutputDatumHash")})),e.withdrawals.forEach((e=>{e.key_hash&&this._ensureFeatureIsSupported("KeyHashStakeCredential")})),e.mint.length>0&&this._ensureFeatureIsSupported("TokenMinting"),(e.additionalWitnessRequests.length>0||e.signingMode===Je.CardanoTxSigningMode.MULTISIG_TRANSACTION)&&this._ensureFeatureIsSupported("Multisig"),e.includeNetworkId&&this._ensureFeatureIsSupported("NetworkIdInTxBody"),e.scriptDataHash&&this._ensureFeatureIsSupported("ScriptDataHash"),e.signingMode===Je.CardanoTxSigningMode.PLUTUS_TRANSACTION&&this._ensureFeatureIsSupported("Plutus"),e.outputsWithData.forEach((({output:e,inlineDatum:t,referenceScript:r})=>{(e.format===Je.CardanoTxOutputSerializationFormat.MAP_BABBAGE||t||r)&&this._ensureFeatureIsSupported("Babbage")})),(e.collateralReturnWithData||null!=e.totalCollateral||e.referenceInputs.length>0)&&this._ensureFeatureIsSupported("Babbage"),e.requiredSigners.length>0&&e.signingMode!==Je.CardanoTxSigningMode.PLUTUS_TRANSACTION&&this._ensureFeatureIsSupported("Babbage"),e.auxiliaryData?.cvote_registration_parameters){const{format:t,delegations:r,voting_purpose:i,payment_address:n}=e.auxiliaryData.cvote_registration_parameters;(t===Je.CardanoCVoteRegistrationFormat.CIP36||r?.length||null!=i)&&this._ensureFeatureIsSupported("CIP36Registration"),n&&this._ensureFeatureIsSupported("CIP36RegistrationExternalPaymentAddress")}}async _sign_tx(){const e=this.device.getCommands().typedCall.bind(this.device.getCommands()),t=!!this.params.auxiliaryData,r={signing_mode:this.params.signingMode,protocol_magic:this.params.protocolMagic,network_id:this.params.networkId,inputs_count:this.params.inputsWithPath.length,outputs_count:this.params.outputsWithData.length,fee:this.params.fee,ttl:this.params.ttl,certificates_count:this.params.certificatesWithPoolOwnersAndRelays.length,withdrawals_count:this.params.withdrawals.length,has_auxiliary_data:t,validity_interval_start:this.params.validityIntervalStart,witness_requests_count:this.params.witnessPaths.length,minting_asset_groups_count:this.params.mint.length,script_data_hash:this.params.scriptDataHash,collateral_inputs_count:this.params.collateralInputsWithPath.length,required_signers_count:this.params.requiredSigners.length,has_collateral_return:null!=this.params.collateralReturnWithData,total_collateral:this.params.totalCollateral,reference_inputs_count:this.params.referenceInputs.length,derivation_type:this.params.derivationType,include_network_id:this.params.includeNetworkId};await e("CardanoSignTxInit","CardanoTxItemAck",r);for(const{input:t}of this.params.inputsWithPath)await e("CardanoTxInput","CardanoTxItemAck",t);for(const t of this.params.outputsWithData)await ii(e,t);for(const{certificate:t,poolOwners:r,poolRelays:i}of this.params.certificatesWithPoolOwnersAndRelays){await e("CardanoTxCertificate","CardanoTxItemAck",t);for(const t of r)await e("CardanoPoolOwner","CardanoTxItemAck",t);for(const t of i)await e("CardanoPoolRelayParameters","CardanoTxItemAck",t)}for(const t of this.params.withdrawals)await e("CardanoTxWithdrawal","CardanoTxItemAck",t);let i;if(this.params.auxiliaryData){const{cvote_registration_parameters:t}=this.params.auxiliaryData;t&&(this.params.auxiliaryData=((e,t)=>{const{cvote_registration_parameters:r}=t;return r?.payment_address_parameters?(r.payment_address_parameters=Ur(e,r.payment_address_parameters),{...t,cvote_registration_parameters:r}):t})(this.device,this.params.auxiliaryData));const{message:r}=await e("CardanoTxAuxiliaryData","CardanoTxAuxiliaryDataSupplement",this.params.auxiliaryData),n=Je.CardanoTxAuxiliaryDataSupplementType[r.type];n!==Je.CardanoTxAuxiliaryDataSupplementType.NONE&&(i={type:n,auxiliaryDataHash:r.auxiliary_data_hash,cVoteRegistrationSignature:r.cvote_registration_signature,catalystSignature:r.cvote_registration_signature,governanceSignature:r.cvote_registration_signature}),await e("CardanoTxHostAck","CardanoTxItemAck")}if(this.params.mint.length>0){await e("CardanoTxMint","CardanoTxItemAck",{asset_groups_count:this.params.mint.length});for(const t of this.params.mint){await e("CardanoAssetGroup","CardanoTxItemAck",{policy_id:t.policyId,tokens_count:t.tokens.length});for(const r of t.tokens)await e("CardanoToken","CardanoTxItemAck",r)}}for(const{collateralInput:t}of this.params.collateralInputsWithPath)await e("CardanoTxCollateralInput","CardanoTxItemAck",t);for(const t of this.params.requiredSigners)await e("CardanoTxRequiredSigner","CardanoTxItemAck",t);this.params.collateralReturnWithData&&await ii(e,this.params.collateralReturnWithData);for(const t of this.params.referenceInputs)await e("CardanoTxReferenceInput","CardanoTxItemAck",t);const n=[];for(const t of this.params.witnessPaths){const{message:r}=await e("CardanoTxWitnessRequest","CardanoTxWitnessResponse",{path:t});n.push({type:Je.CardanoTxWitnessType[r.type],pubKey:r.pub_key,signature:r.signature,chainCode:r.chain_code})}const{message:s}=await e("CardanoTxHostAck","CardanoTxBodyHash");return await e("CardanoTxHostAck","CardanoSignTxFinished"),{hash:s.tx_hash,witnesses:n,auxiliaryDataSupplement:i}}run(){return this._ensureFirmwareSupportsParams(),this._sign_tx()}}class ai extends St{init(){this.requiredPermissions=["management"],this.useDeviceState=!1;const{payload:e}=this;It(e,[{name:"remove",type:"boolean"}]),this.params={remove:e.remove}}async run(){const e=this.device.getCommands();return(await e.typedCall("ChangePin","Success",this.params)).message}}var ui=__webpack_require__("../../node_modules/buffer/index.js").Buffer;class hi extends St{init(){this.requiredPermissions=["read","write"],this.firmwareRange=At(this.name,null,this.firmwareRange),this.hasBundle=!!this.payload.bundle;const e=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};this.useEmptyPassphrase="boolean"!=typeof e.useEmptyPassphrase||e.useEmptyPassphrase,It(e,[{name:"bundle",type:"array"}]),this.params=e.bundle.map((e=>(It(e,[{name:"path",required:!0},{name:"key",type:"string"},{name:"value",type:"string"},{name:"encrypt",type:"boolean"},{name:"askOnEncrypt",type:"boolean"},{name:"askOnDecrypt",type:"boolean"},{name:"iv",type:"string"}]),{address_n:x(e.path),key:e.key,value:e.value instanceof ui?e.value.toString("hex"):e.value,encrypt:e.encrypt,ask_on_encrypt:e.askOnEncrypt,ask_on_decrypt:e.askOnDecrypt,iv:e.iv instanceof ui?e.iv.toString("hex"):e.iv})))}get info(){return"Cipher key value"}async run(){const e=[],t=this.device.getCommands();for(let r=0;r`${new Er(e).div(10**t.decimals).toString(10)} ${t.shortcut}`,ci=e=>(e=>"0x"===e.slice(0,2).toLowerCase())(e)?e.slice(2):e,fi=e=>{let t;if("string"!=typeof(r=e)||!r.match(/^(0x|0X)?[0-9A-Fa-f]*$/)||i&&r.length!==2+2*i)t=li.from(e);else{let r=ci(e);r.length%2!=0&&(r=`0${r}`),t=li.from(r,"hex")}var r,i;return t.toString("hex")};class pi extends(r()){types=[];constructor(e){super(),this.accounts=[],this.index=0,this.typeIndex=0,this.interrupted=!1,this.completed=!1,this.blockchain=e.blockchain,this.commands=e.commands,this.coinInfo=e.blockchain.coinInfo,this.derivationType=e.derivationType;const{coinInfo:t}=this;if("bitcoin"===t.type){const e=(e,r)=>Re(t,r,{purpose:e});t.xPubMagicSegwitNative&&this.types.push({type:"p2wpkh",getPath:e.bind(this,84)}),t.xPubMagicSegwit&&this.types.push({type:"p2sh",getPath:e.bind(this,49)}),this.types.push({type:"p2pkh",getPath:e.bind(this,44)})}else this.types.push({type:"p2pkh",getPath:Re.bind(this,t)})}async start(e){for(this.interrupted=!1;!this.completed&&!this.interrupted;){const t=this.types[this.typeIndex],r=`Account #${this.index+1}`,i=this.index>=10,n=t.getPath(this.index),s=await this.commands.getAccountDescriptor(this.coinInfo,n,this.derivationType);if(!s)throw g("Runtime","Discovery: descriptor not found");if(this.interrupted)return;const o={...s,type:t.type,label:r};this.accounts=this.accounts.filter((e=>e.descriptor!==o.descriptor)),i||(this.accounts.push(o),this.emit("progress",this.accounts));const a=await this.blockchain.getAccountInfo({descriptor:o.descriptor,details:e});if(this.interrupted)return;if(this.accounts=this.accounts.filter((e=>e.descriptor!==o.descriptor)),!i||i&&!a.empty){const e=di(a.availableBalance,this.coinInfo);this.accounts.push({...o,empty:a.empty,balance:e,addresses:a.addresses}),this.emit("progress",this.accounts)}a.empty?this.typeIndex+1((e,t)=>{try{const r=Te.Lk.fromBase58Check(e,t);if(r.version!==t.pubKeyHash&&r.version!==t.scriptHash)return!1}catch(e){return!1}return!0})(e,t.network)||((e,t)=>{try{if(Te.Lk.fromBech32(e).prefix!==t.bech32)return!1}catch(e){return!1}return!0})(e,t.network),bi=(e,t)=>{if(e.opReturnData){if(e.value)throw g("Method_InvalidParameter","opReturn output should not contains value");return{amount:"0",op_return_data:e.opReturnData.toString("hex"),script_type:"PAYTOOPRETURN"}}if(!e.address&&!e.path)throw g("Method_InvalidParameter","Both address and path of an output cannot be null.");if(e.path)return{address_n:e.path,amount:e.value,script_type:k(e.path)};const{address:r,value:i}=e;if("string"!=typeof r)throw g("Method_InvalidParameter","Wrong output address type, should be string");return{address:r,amount:i,script_type:"PAYTOADDRESS"}};class gi{blockHeight=0;composed={};constructor(e){this.account=e.account,this.outputs=e.outputs,this.coinInfo=e.coinInfo,this.blockHeight=0,this.baseFee=e.baseFee||0,this.skipPermutation=e.skipPermutation||!1,this.feeLevels=new Tr(e.coinInfo);const{addresses:t}=e.account,r=t?t.used.concat(t.unused).concat(t.change).map((e=>e.address)):[];this.utxos=e.utxo.flatMap((e=>{if(!e.required&&new Er(e.amount).lt(this.coinInfo.dustLimit))return[];const t=T(e.path),[i,n]=t.slice(t.length-2);return{index:e.vout,transactionHash:e.txid,value:e.amount,addressPath:[i,n],height:e.blockHeight,tsize:0,vsize:0,coinbase:"boolean"==typeof e.coinbase&&e.coinbase,own:r.indexOf(e.address)>=0,required:e.required}}))}async init(e){const{blockHeight:t}=await e.getNetworkInfo();this.blockHeight=t,await this.feeLevels.load(e)}composeAllFeeLevels(){const{levels:e}=this.feeLevels;if(this.utxos.length<1)return!1;this.composed={};let t=!1;if(e.forEach((e=>{if("0"!==e.feePerUnit){const r=this.compose(e.feePerUnit);"final"===r.type&&(t=!0),this.composed[e.label]=r}})),!t){const t=e[e.length-1];let r=new Er(t.feePerUnit);for(;r.gt(this.coinInfo.minFee)&&void 0===this.composed.custom;){r=r.minus(1);const e=this.compose(r.toString());if("final"===e.type)return this.feeLevels.updateCustomFee(r.toString()),this.composed.custom=e,!0}return!1}return!0}composeCustomFee(e){const t=this.compose(e);this.composed.custom=t,"final"===t.type?this.feeLevels.updateCustomFee(t.feePerByte):this.feeLevels.updateCustomFee(e)}getFeeLevelList(){const e=[],{levels:t}=this.feeLevels;return t.forEach((t=>{const r=this.composed[t.label];r&&"final"===r.type?e.push({name:t.label,fee:r.fee,feePerByte:t.feePerUnit,minutes:t.blocks*this.coinInfo.blockTime,total:r.totalSpent}):e.push({name:t.label,fee:"0",disabled:!0})})),e}compose(e){const{account:t,coinInfo:r,baseFee:i}=this,{addresses:n}=t;if(!n)return{type:"error",error:"ADDRESSES-NOT-SET"};const s=n.change.find((e=>!e.transfers))||n.change[n.change.length-1],o=T(s.path).slice(-1)[0];return(0,Te.c5)({txType:t.type,utxos:this.utxos,outputs:this.outputs,height:this.blockHeight,feeRate:e,longTermFeeRate:this.feeLevels.longTermFeeRate,skipPermutation:this.skipPermutation,basePath:t.address_n,network:r.network,changeId:o,changeAddress:s.address,dustThreshold:r.dustLimit,baseFee:i})}dispose(){}}const yi=(e,t)=>{const r=e.path;return{address_n:r,prev_index:e.index,prev_hash:n.bufferUtils.reverseBuffer(e.hash).toString("hex"),script_type:j(r),amount:e.amount,sequence:t}},vi=(e,t)=>{if(("ZEC"===t.shortcut||"TAZ"===t.shortcut)&&("boolean"!=typeof e.overwintered&&(e.overwintered=!0),"number"!=typeof e.version&&(e.version=5),"number"!=typeof e.version_group_id&&(e.version_group_id=648488714),"number"!=typeof e.branch_id)){const r=Qt(t.shortcut);r&&r.serverInfo?.consensusBranchId?e.branch_id=r.serverInfo.consensusBranchId:e.branch_id=3268858036}return"KMD"===t.shortcut&&("boolean"!=typeof e.overwintered&&(e.overwintered=!0),"number"!=typeof e.version&&(e.version=4),"number"!=typeof e.version_group_id&&(e.version_group_id=2301567109),"number"!=typeof e.branch_id&&(e.branch_id=1991772603)),"KOTO"===t.shortcut&&("boolean"!=typeof e.overwintered&&(e.overwintered=!0),"number"!=typeof e.version&&(e.version=4),"number"!=typeof e.version_group_id&&(e.version_group_id=2301567109),"number"!=typeof e.branch_id&&(e.branch_id=733220448)),"PPC"!==t.shortcut&&"tPPC"!==t.shortcut||"number"!=typeof e.timestamp&&(e.timestamp=Math.round((new Date).getTime()/1e3)),e},wi=(e,t={},r)=>{if("ZEC"===r?.shortcut||"TAZ"===r?.shortcut)return!(t.version&&t.version>=5);const i=["SPENDTAPROOT","EXTERNAL"];return!!e.find((e=>!i.find((t=>t===e.script_type))))},_i=e=>{const t=[];return e.forEach((e=>{e.prev_hash&&!t.includes(e.prev_hash)&&t.push(e.prev_hash)})),t},Mi=(e,t)=>{const r=[];return e.forEach((e=>{e.orig_hash&&!r.includes(e.orig_hash)&&r.push(e.orig_hash)})),t.forEach((e=>{e.orig_hash&&!r.includes(e.orig_hash)&&r.push(e.orig_hash)})),r},Ei=(e,t)=>{const r=t.getExtraData();r&&(e.extra_data=r.toString("hex"));const i=t.getSpecificData();return i&&("zcash"===i.type&&i.versionGroupId&&e.version>=3&&(e.version_group_id=i.versionGroupId),"dash"===i.type&&t.type&&t.version>=3&&(e.version|=t.type<<16)),e},Si=(e,t,r)=>{const{vin:i,vout:s,txid:o}=e,a=r.used.concat(r.change).concat(r.unused),u={version:t.version,hash:t.getId(),inputs:t.ins.map(((e,r)=>{const s=i[r];if(!s?.value||!s?.addresses||1!==s.addresses.length)throw g("Method_InvalidParameter",`transformOrigTransactions: invalid input at ${o} [${r}]`);const[u]=s.addresses,h=a.find((e=>e.address===u)),l=T(h?.path||"");return{address_n:l,prev_hash:n.bufferUtils.reverseBuffer(e.hash).toString("hex"),prev_index:e.index,script_sig:e.script.toString("hex"),sequence:e.sequence,script_type:j(l),multisig:void 0,amount:s.value,decred_tree:void 0,witness:t.getWitness(r)?.toString("hex"),ownership_proof:void 0,commitment_data:void 0}})),outputs:t.outs.map(((e,t)=>{const i=s[t];if(!i.isAddress){const{data:r}=Te.PP.embed({output:e.script}),i=r?.shift()?.toString("hex");if("string"!=typeof i)throw g("Method_InvalidParameter",`transformOrigTransactions: invalid op_return_data at ${o} [${t}]`);return{script_type:"PAYTOOPRETURN",amount:"0",op_return_data:i}}if(!i.addresses||1!==i.addresses.length)throw g("Method_InvalidParameter",`transformOrigTransactions: invalid output at ${o} [${t}]`);const[n]=i.addresses,a=r.change.find((e=>e.address===n)),u=a&&T(a.path),h=e.value.toString();return u?{address_n:u,amount:h,script_type:k(u)}:{address:n,amount:h,script_type:"PAYTOADDRESS"}})),lock_time:t.locktime,timestamp:t.timestamp,expiry:t.expiry};return Ei(u,t)},Ti=e=>"blockbook"===e.type&&!!e.tx.hex,Ii=e=>{const t={version:e.version,hash:e.getId(),inputs:e.ins.map((e=>({prev_index:e.index,sequence:e.sequence,prev_hash:n.bufferUtils.reverseBuffer(e.hash).toString("hex"),script_sig:e.script.toString("hex")}))),bin_outputs:e.outs.map((e=>({amount:e.value.toString(),script_pubkey:e.script.toString("hex")}))),lock_time:e.locktime,timestamp:e.timestamp,expiry:e.expiry};return Ei(t,e)},Oi=(e,t)=>"bitcoin"!==t.type?[]:e.filter(Ti).map((e=>{const r=Te.YW.fromHex(e.tx.hex,{network:t.network});return Ii(r)})),Ai=({transactions:e,inputs:t,outputs:r,addresses:i,coinInfo:n})=>{if(!Array.isArray(e)||0===e.length)return;const s=wi(t)?_i(t):[],o=Mi(t,r),a=e.map((e=>"details"in e?o.includes(e.txid)?(({tx:e,addresses:t,coinInfo:r})=>{if(!e.hex)throw g("Method_InvalidParameter",`refTx: hex for ${e.txid} not provided`);if(!t)throw g("Method_InvalidParameter",`refTx: addresses for ${e.txid} not provided`);const i=Te.YW.fromHex(e.hex,{network:r.network});return Si({...e.details,txid:e.txid},i,t)})({tx:e,addresses:i,coinInfo:n}):(({tx:e,coinInfo:t})=>{if(!e.hex)throw g("Method_InvalidParameter",`refTx: hex for ${e.txid} not provided`);const r=Te.YW.fromHex(e.hex,{network:t.network});return Ii(r)})({tx:e,coinInfo:n}):(It(e,[{name:"hash",type:"string",required:!0},{name:"inputs",type:"array",required:!0},{name:"version",type:"number",required:!0},{name:"lock_time",type:"number",required:!0},{name:"extra_data",type:"string"},{name:"timestamp",type:"number"},{name:"version_group_id",type:"number"}]),o.includes(e.hash)?(It(e,[{name:"outputs",type:"array",required:!0}]),e):(It(e,[{name:"bin_outputs",type:"array",required:!0}]),e.inputs.forEach((e=>{It(e,[{name:"prev_hash",type:"string",required:!0},{name:"prev_index",type:"number",required:!0},{name:"script_sig",type:"string",required:!0},{name:"sequence",type:"number",required:!0},{name:"decred_tree",type:"number"}])})),{hash:e.hash,version:e.version,extra_data:e.extra_data,lock_time:e.lock_time,timestamp:e.timestamp,version_group_id:e.version_group_id,expiry:e.expiry,inputs:e.inputs.map((e=>({prev_hash:e.prev_hash,prev_index:e.prev_index,script_sig:e.script_sig,sequence:e.sequence,decred_tree:e.decred_tree}))),bin_outputs:e.bin_outputs.map((e=>({amount:e.amount,script_pubkey:e.script_pubkey,decred_script_version:e.decred_script_version})))}))));return s.concat(o).forEach((e=>{if(!a.find((t=>t.hash===e)))throw g("Method_InvalidParameter",`refTx: ${e} not provided`)})),a};var ji=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;const ki=e=>{const{tx_hash:t}=e.txRequest.details;return t?(({typedCall:e,txRequest:{request_type:t,details:r},refTxs:i})=>{const{tx_hash:n}=r;if(!n)throw g("Runtime","requestPrevTxInfo: unknown details.tx_hash");const s=i[n.toLowerCase()];if(!s)throw g("Runtime",`requestPrevTxInfo: Requested unknown tx: ${n}`);if("TXINPUT"===t){if(!s.bin_outputs)throw g("Runtime",`requestPrevTxInfo: Requested unknown TXINPUT: ${n}`);return e("TxAckPrevInput","TxRequest",{tx:{input:s.inputs[r.request_index]}})}if("TXOUTPUT"===t){if(!s.bin_outputs)throw g("Runtime",`requestPrevTxInfo: Requested unknown TXOUTPUT: ${n}`);return e("TxAckPrevOutput","TxRequest",{tx:{output:s.bin_outputs[r.request_index]}})}if("TXORIGINPUT"===t){if(!s.outputs)throw g("Runtime",`requestPrevTxInfo: Requested unknown TXORIGINPUT: ${n}`);return e("TxAckInput","TxRequest",{tx:{input:s.inputs[r.request_index]}})}if("TXORIGOUTPUT"===t){if(!s.outputs)throw g("Runtime",`requestPrevTxInfo: Requested unknown TXORIGOUTPUT: ${n}`);return e("TxAckOutput","TxRequest",{tx:{output:s.outputs[r.request_index]}})}if("TXEXTRADATA"===t){if("number"!=typeof r.extra_data_len)throw g("Runtime","requestPrevTxInfo: Missing extra_data_len");if("number"!=typeof r.extra_data_offset)throw g("Runtime","requestPrevTxInfo: Missing extra_data_offset");if("string"!=typeof s.extra_data)throw g("Runtime",`requestPrevTxInfo: No extra data for transaction ${s.hash}`);const t=s.extra_data,i=r.extra_data_len,n=r.extra_data_offset;return e("TxAckPrevExtraData","TxRequest",{tx:{extra_data_chunk:t.substring(2*n,2*(n+i))}})}if("TXMETA"===t){const t=s.extra_data;return e("TxAckPrevMeta","TxRequest",{tx:{version:s.version,lock_time:s.lock_time,inputs_count:s.inputs.length,outputs_count:s.outputs?s.outputs.length:s.bin_outputs.length,timestamp:s.timestamp,version_group_id:s.version_group_id,expiry:s.expiry,branch_id:s.branch_id,extra_data_len:t?t.length/2:void 0}})}throw g("Runtime",`requestPrevTxInfo: Unknown request type: ${t}`)})(e):(({typedCall:e,txRequest:{request_type:t,details:r},inputs:i,outputs:n,paymentRequests:s})=>{if("TXINPUT"===t)return e("TxAckInput","TxRequest",{tx:{input:i[r.request_index]}});if("TXOUTPUT"===t)return e("TxAckOutput","TxRequest",{tx:{output:n[r.request_index]}});if("TXPAYMENTREQ"===t){const t=s[r.request_index];if(!t)throw g("Runtime",`requestPrevTxInfo: Requested unknown payment request at ${r.request_index}`);return e("TxAckPaymentRequest","TxRequest",{nonce:t.nonce,recipient_name:t.recipient_name,memos:t.memos,amount:t.amount,signature:t.signature})}if("TXMETA"===t)throw g("Runtime","requestSignedTxInfo: Cannot read TXMETA from signed transaction");if("TXEXTRADATA"===t)throw g("Runtime","requestSignedTxInfo: Cannot read TXEXTRADATA from signed transaction");throw g("Runtime",`requestSignedTxInfo: Unknown request type: ${t}`)})(e)},xi=async e=>{const{txRequest:t,serializedTx:r,signatures:i}=e;if(t.serialized&&((e,t,r)=>{const{signature_index:i,signature:n,serialized_tx:s}=e;if(s&&t.push(s),"number"==typeof i){if(!n)throw g("Runtime","saveTxSignatures: Unexpected null in trezor:TxRequestSerialized signature.");r[i]=n}})(t.serialized,r,i),"TXFINISHED"===t.request_type)return ji.resolve({signatures:i,serializedTx:r.join("")});const{message:n}=await ki(e);return xi({...e,txRequest:n})},Ri=async({typedCall:e,inputs:t,outputs:r,paymentRequests:i,refTxs:n,options:s,coinInfo:o})=>{const{message:a}=await e("SignTx","TxRequest",{...s,inputs_count:t.length,outputs_count:r.length,coin_name:o.name});return xi({typedCall:e,txRequest:a,refTxs:n.reduce(((e,t)=>({...e,[t.hash.toLowerCase()]:t})),{}),inputs:t,outputs:r,paymentRequests:i||[],serializedTx:[],signatures:[]})};var Pi=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;const Ni=e=>{const{tx_hash:t}=e.txRequest.details;return t?(({txRequest:{request_type:e,details:t},refTxs:r})=>{const{tx_hash:i}=t;if(!i)throw g("Runtime","requestPrevTxInfo: unknown details.tx_hash");const n=r[i.toLowerCase()];if(!n)throw g("Runtime",`requestPrevTxInfo: Requested unknown tx: ${i}`);if(!n.bin_outputs)throw g("Runtime",`requestPrevTxInfo: bin_outputs not set tx: ${i}`);if("TXINPUT"===e)return{inputs:[n.inputs[t.request_index]]};if("TXOUTPUT"===e)return{bin_outputs:[n.bin_outputs[t.request_index]]};if("TXEXTRADATA"===e){if("number"!=typeof t.extra_data_len)throw g("Runtime","requestPrevTxInfo: Missing extra_data_len");if("number"!=typeof t.extra_data_offset)throw g("Runtime","requestPrevTxInfo: Missing extra_data_offset");if("string"!=typeof n.extra_data)throw g("Runtime",`requestPrevTxInfo: No extra data for transaction ${n.hash}`);const e=n.extra_data,r=t.extra_data_len,i=t.extra_data_offset;return{extra_data:e.substring(2*i,2*(i+r))}}if("TXMETA"===e){const e=n.extra_data,t={version:n.version,lock_time:n.lock_time,inputs_cnt:n.inputs.length,outputs_cnt:n.bin_outputs.length,timestamp:n.timestamp,version_group_id:n.version_group_id,expiry:n.expiry,branch_id:n.branch_id};return"string"==typeof e&&0!==e.length?{...t,extra_data_len:e.length/2}:t}throw g("Runtime",`requestPrevTxInfo: Unknown request type: ${e}`)})(e):(({txRequest:{request_type:e,details:t},inputs:r,outputs:i})=>{if("TXINPUT"===e)return{inputs:[r[t.request_index]]};if("TXOUTPUT"===e)return{outputs:[i[t.request_index]]};if("TXMETA"===e)throw g("Runtime","requestSignedTxInfo: Cannot read TXMETA from signed transaction");if("TXEXTRADATA"===e)throw g("Runtime","requestSignedTxInfo: Cannot read TXEXTRADATA from signed transaction");throw g("Runtime",`requestSignedTxInfo: Unknown request type: ${e}`)})(e)},Ci=async e=>{const{typedCall:t,txRequest:r,serializedTx:i,signatures:n}=e;if(r.serialized&&((e,t,r)=>{if(!e)return;const{signature_index:i,signature:n,serialized_tx:s}=e;if(s&&t.push(s),"number"==typeof i){if(!n)throw g("Runtime","saveTxSignatures: Unexpected null in trezor:TxRequestSerialized signature.");r[i]=n}})(r.serialized,i,n),"TXFINISHED"===r.request_type)return Pi.resolve({signatures:n,serializedTx:i.join("")});const s=Ni(e),{message:o}=await t("TxAck","TxRequest",{tx:s});return Ci({...e,txRequest:o})},Bi=async({typedCall:e,inputs:t,outputs:r,refTxs:i,options:n,coinInfo:s})=>{const{message:o}=await e("SignTx","TxRequest",{...n,inputs_count:t.length,outputs_count:r.length,coin_name:s.name});return Ci({typedCall:e,txRequest:o,refTxs:i.reduce(((e,t)=>({...e,[t.hash.toLowerCase()]:t})),{}),inputs:t,outputs:r,paymentRequests:[],serializedTx:[],signatures:[]})};var Ui=__webpack_require__("../../node_modules/buffer/index.js").Buffer;const Di=async(e,t,r,i)=>{if(5===e.length){const n=await t({address_n:e.slice(0,4)},{coinInfo:r,unlockPath:i});return Te._K.fromBase58(n.xpub,r.network).derive(e[e.length-1])}const n=await t({address_n:e},{coinInfo:r,unlockPath:i});return Te._K.fromBase58(n.xpub,r.network)},Li=async(e,t,r,i)=>{if("multisig"in t)return;if("op_return_data"in t)return Te.PP.embed({data:[Ui.from(t.op_return_data,"hex")]}).output;if(t.address)return Te.Lk.toOutputScript(t.address,r.network);if(!t.address_n)throw g("Runtime","deriveOutputScript: Neither address or address_n is set");const n=await Di(t.address_n,e,r,i),s={hash:n.identifier,network:r.network};if("PAYTOADDRESS"===t.script_type)return Te.PP.p2pkh(s).output;if("PAYTOSCRIPTHASH"===t.script_type)return Te.PP.p2sh(s).output;if("PAYTOP2SHWITNESS"===t.script_type)return Te.PP.p2sh({redeem:Te.PP.p2wpkh(s)}).output;if("PAYTOWITNESS"===t.script_type)return Te.PP.p2wpkh(s).output;if("PAYTOTAPROOT"===t.script_type)return Te.PP.p2tr({pubkey:n.publicKey,network:r.network}).output;if("PAYTOMULTISIG"===t.script_type)throw g("Runtime","deriveOutputScript: script_type PAYTOMULTISIG not expected without multisig defined");throw g("Runtime",`deriveOutputScript: Unknown script type ${t.script_type}`)},qi=async(e,t,r,i,n,s)=>{const o=Te.YW.fromHex(i,{network:n.network});if(t.length!==o.ins.length)throw g("Runtime","verifyTx: Signed transaction inputs invalid length");if(r.length!==o.outs.length)throw g("Runtime","verifyTx: Signed transaction outputs invalid length");for(let t=0;t{const n=((e,t)=>{const r=e=>{if(!e||!mi(e,t))throw g("Method_InvalidParameter",`Invalid ${t.label} output address format`)};switch(e.type){case"opreturn":return It(e,[{name:"dataHex",type:"string"}]),{type:"opreturn",dataHex:e.dataHex||""};case"send-max":return It(e,[{name:"address",type:"string",required:!0}]),r(e.address),{type:"send-max",address:e.address};case"noaddress":return It(e,[{name:"amount",type:"uint",required:!0}]),{type:"noaddress",amount:e.amount};case"send-max-noaddress":return{type:"send-max-noaddress"};default:return It(e,[{name:"amount",type:"uint",required:!0},{name:"address",type:"string",required:!0}]),r(e.address),{type:"complete",address:e.address,amount:e.amount}}})(e,t);"amount"in n&&"string"==typeof n.amount&&(i=i.plus(n.amount)),r.push(n)})),this.useDevice=!e.account&&!e.feeLevels,this.useUi=this.useDevice,this.params={outputs:r,coinInfo:t,account:e.account,feeLevels:e.feeLevels,baseFee:e.baseFee,floorBaseFee:e.floorBaseFee,sequence:e.sequence,skipPermutation:e.skipPermutation,push:"boolean"==typeof e.push&&e.push,total:i}}get info(){return void 0!==this.params?.outputs.find((e=>"send-max"===e.type))?"Send maximum amount":`Send ${di(this.params.total.toString(),this.params.coinInfo)}`}async precompose(e,t){const{coinInfo:r,outputs:i,baseFee:n,skipPermutation:s}=this.params,o=x(e.path),a=new gi({account:{type:(u=o,A(u)?"p2tr":O(u)?"p2wpkh":I(u)?"p2sh":"p2pkh"),label:"Account",descriptor:e.path,address_n:o,addresses:e.addresses},utxo:e.utxo,coinInfo:r,outputs:i,baseFee:n,skipPermutation:s});var u;const h=await tr(this.params.coinInfo,this.postMessage);return await a.init(h),t.map((e=>{a.composeCustomFee(e.feePerUnit);const t={...a.composed.custom};if("final"===t.type){const e=t.transaction.inputs.map((e=>yi(e,this.params.sequence||4294967295))),{sorted:r,permutation:i}=t.transaction.outputs,n=r.map((e=>bi(e)));return{type:"final",max:t.max,totalSpent:t.totalSpent,fee:t.fee,feePerByte:t.feePerByte,bytes:t.bytes,transaction:{inputs:e,outputs:n,outputsPermutation:i}}}return t}))}async run(){if(this.params.account&&this.params.feeLevels)return this.precompose(this.params.account,this.params.feeLevels);const{account:e,utxo:t}=await this.selectAccount(),r=await this.selectFee(e,t);if(!this.discovery)throw g("Runtime","ComposeTransaction: selectFee response received after dispose");return"string"==typeof r?this.run():r}async selectAccount(){const{coinInfo:e}=this.params,t=await tr(e,this.postMessage),r=this.createUiPromise(Xe.RECEIVE_ACCOUNT);if(this.discovery&&this.discovery.completed){const{discovery:i}=this;this.postMessage(Ye(Xe.SELECT_ACCOUNT,{type:"end",coinInfo:e,accountTypes:i.types.map((e=>e.type)),accounts:i.accounts}));const n=await r.promise,s=i.accounts[n.payload];return{account:s,utxo:await t.getAccountUtxo(s.descriptor)}}const i=this.discovery||new pi({blockchain:t,commands:this.device.getCommands()});this.discovery=i,i.on("progress",(t=>{this.postMessage(Ye(Xe.SELECT_ACCOUNT,{type:"progress",coinInfo:e,accounts:t}))})),i.on("complete",(()=>{this.postMessage(Ye(Xe.SELECT_ACCOUNT,{type:"end",coinInfo:e}))})),i.start("tokens").catch((e=>{r.reject(e)})),this.postMessage(Ye(Xe.SELECT_ACCOUNT,{type:"start",accountTypes:i.types.map((e=>e.type)),coinInfo:e}));const n=await r.promise;i.removeAllListeners(),i.stop(),i.completed||await ut(501).promise;const s=i.accounts[n.payload];this.params.coinInfo=H(this.params.coinInfo,s.address_n);return{account:s,utxo:await t.getAccountUtxo(s.descriptor)}}async selectFee(e,t){const{coinInfo:r,outputs:i}=this.params,n=await tr(r,this.postMessage),s=new gi({account:e,utxo:t,coinInfo:r,outputs:i});await s.init(n);return s.composeAllFeeLevels()?(this.postMessage(Ye(Xe.SELECT_FEE,{feeLevels:s.getFeeLevelList(),coinInfo:this.params.coinInfo})),this._selectFeeUiResponse(s)):(this.postMessage(Ye(Xe.INSUFFICIENT_FUNDS)),await ut(2e3,null).promise,"change-account")}async _selectFeeUiResponse(e){const t=await this.createUiPromise(Xe.RECEIVE_FEE).promise;switch(t.payload.type){case"compose-custom":return e.composeCustomFee(t.payload.value),this.postMessage(Ye(Xe.UPDATE_CUSTOM_FEE,{feeLevels:e.getFeeLevelList(),coinInfo:this.params.coinInfo})),this._selectFeeUiResponse(e);case"send":return this._sign(e.composed[t.payload.value]);default:return"change-account"}}async _sign(e){if("final"!==e.type)throw g("Runtime","ComposeTransaction: Trying to sign unfinished tx");const{coinInfo:t}=this.params,r=vi({},t),i=e.transaction.inputs.map((e=>yi(e,this.params.sequence||4294967295))),n=e.transaction.outputs.sorted.map((e=>bi(e)));let s=[];const o=wi(i,r,t),a=_i(i);if(o&&a.length>0){const e=await tr(t,this.postMessage),r=await e.getTransactions(a);s=Oi(r,t)}const u=this.device.unavailableCapabilities.replaceTransaction?Bi:Ri,h=await u({typedCall:this.device.getCommands().typedCall.bind(this.device.getCommands()),inputs:i,outputs:n,refTxs:s,options:r,coinInfo:t});if(await qi(this.device.getCommands().getHDNode.bind(this.device.getCommands()),i,n,h.serializedTx,t),this.params.push){const e=await tr(t,this.postMessage),r=await e.pushTransaction(h.serializedTx);return{...h,txid:r}}return h}dispose(){const{discovery:e}=this;e&&(e.stop(),e.removeAllListeners(),this.discovery=void 0)}}class zi extends St{init(){this.requiredPermissions=["read"],this.firmwareRange=At(this.name,q("EOS"),this.firmwareRange),this.hasBundle=!!this.payload.bundle;const e=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};It(e,[{name:"bundle",type:"array"}]),this.params=e.bundle.map((e=>{It(e,[{name:"path",required:!0},{name:"showOnTrezor",type:"boolean"}]);return{address_n:x(e.path,3),show_display:"boolean"==typeof e.showOnTrezor&&e.showOnTrezor}}))}get info(){return"Export Eos public key"}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);let t;t=this.params.length>1?"Export multiple Eos public keys":`Export Eos public key for account #${_(this.params[0].address_n[2])+1}`,this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:t}));const r=await e.promise;return this.confirmed=r.payload,this.confirmed}async run(){const e=[],t=this.device.getCommands();for(let r=0;r{const r=Array(t).fill("0".charCodeAt(0));for(let t=e.length-1;t>=0;--t){let i=e[t];for(let e=0;e{if("string"!=typeof e)throw g("Method_InvalidParameter",`Eos serialization error, "${typeof e}" should be a string`);const t=e=>e>="a".charCodeAt(0)&&e<="z".charCodeAt(0)?e-"a".charCodeAt(0)+6:e>="1".charCodeAt(0)&&e<="5".charCodeAt(0)?e-"1".charCodeAt(0)+1:0,r=new Uint8Array(8);let i=63;for(let n=0;n=0;--e)i>=0&&(r[Math.floor(i/8)]|=(s>>e&1)<{if("string"!=typeof e)throw g("Method_InvalidParameter","Eos serialization error. Expected string containing asset, got: "+typeof e);let t=0,r="",i=0;"-"===(e=e.trim())[t]&&(r+="-",++t);let n=!1;for(;t="0".charCodeAt(0)&&e.charCodeAt(t)<="9".charCodeAt(0);)n=!0,r+=e[t],++t;if(!n)throw g("Method_InvalidParameter","Eos serialization error. Asset must begin with a number");if("."===e[t])for(++t;t="0".charCodeAt(0)&&e.charCodeAt(t)<="9".charCodeAt(0);)r+=e[t],++i,++t;const s=e.substring(t).trim(),o=[255&i];for(let e=0;e{const t=e=>{const t=0===e.indexOf("EOS")?3:7,r=Vi.from(Hi.decode(e.substring(t)));return{type:0,key:r.subarray(0,r.length-4).toString("hex")}};return{threshold:e.threshold,keys:e.keys.map((e=>({weight:e.weight,...t(e.key)}))),accounts:e.accounts.map((e=>({weight:e.weight,account:{actor:Wi(e.permission.actor),permission:Wi(e.permission.permission)}}))),waits:e.waits}},Zi=e=>{if("string"!=typeof e)throw g("Method_InvalidParameter","Eos serialization error. Header.expiration should be string or number");return"Z"!==e.substring(e.length-1,e.length)&&(e+="Z"),Date.parse(e)/1e3},Yi=e=>({account:Wi(e.account),name:Wi(e.name),authorization:e.authorization.map((e=>({actor:Wi(e.actor),permission:Wi(e.permission)})))}),Xi=e=>{const t=(e=>{switch(e.name){case"transfer":return{transfer:{sender:Wi(e.data.from),receiver:Wi(e.data.to),quantity:Ki(e.data.quantity),memo:e.data.memo}};case"delegatebw":return{delegate:{sender:Wi(e.data.from),receiver:Wi(e.data.receiver),net_quantity:Ki(e.data.stake_net_quantity),cpu_quantity:Ki(e.data.stake_cpu_quantity),transfer:e.data.transfer}};case"undelegatebw":return{undelegate:{sender:Wi(e.data.from),receiver:Wi(e.data.receiver),net_quantity:Ki(e.data.unstake_net_quantity),cpu_quantity:Ki(e.data.unstake_cpu_quantity)}};case"buyram":return{buy_ram:{payer:Wi(e.data.payer),receiver:Wi(e.data.receiver),quantity:Ki(e.data.quant)}};case"buyrambytes":return{buy_ram_bytes:{payer:Wi(e.data.payer),receiver:Wi(e.data.receiver),bytes:e.data.bytes}};case"sellram":return{sell_ram:{account:Wi(e.data.account),bytes:e.data.bytes}};case"voteproducer":return{vote_producer:{voter:Wi(e.data.voter),proxy:Wi(e.data.proxy),producers:e.data.producers.map((e=>Wi(e)))}};case"refund":return{refund:{owner:Wi(e.data.owner)}};case"updateauth":return{update_auth:{account:Wi(e.data.account),permission:Wi(e.data.permission),parent:Wi(e.data.parent),auth:$i(e.data.auth)}};case"deleteauth":return{delete_auth:{account:Wi(e.data.account),permission:Wi(e.data.permission)}};case"linkauth":return{link_auth:{account:Wi(e.data.account),code:Wi(e.data.code),type:Wi(e.data.type),requirement:Wi(e.data.requirement)}};case"unlinkauth":return{unlink_auth:{account:Wi(e.data.account),code:Wi(e.data.code),type:Wi(e.data.type)}};case"newaccount":return{new_account:{creator:Wi(e.data.creator),name:Wi(e.data.name),owner:$i(e.data.owner),active:$i(e.data.active)}};default:return null}})(e)||(e=>"string"!=typeof e.data?null:{unknown:{data_size:e.data.length/2,data_chunk:e.data}})(e);return{common:Yi(e),...t}},Ji=2048,Qi=async(e,t,r,i)=>{const n=r[i],s=i+1>=r.length;let o;const a=t.data_size;if(n.unknown){const{unknown:t}=n,r="number"==typeof a?a:0,u=((e,t)=>{if(!e||t<0||e.length0?e.length-2*t:0;return e.substring(r,r+4096)})(t.data_chunk,r),h={common:n.common,unknown:{data_size:t.data_size,data_chunk:u}},l=(r>0?t.data_size-r+Ji:Ji)>=t.data_size;if(s&&l){return(await e("EosTxActionAck","EosSignedTx",h)).message}o=await e("EosTxActionAck","EosTxActionRequest",h),l&&i++}else{if(s){return(await e("EosTxActionAck","EosSignedTx",n)).message}o=await e("EosTxActionAck","EosTxActionRequest",n),i++}return Qi(e,o.message,r,i)};class en extends St{init(){this.requiredPermissions=["read","write"],this.firmwareRange=At(this.name,q("EOS"),this.firmwareRange);const{payload:e}=this;It(e,[{name:"path",required:!0},{name:"transaction",required:!0}]);const t=x(e.path,3),{chain_id:r,header:i,ack:n}=(e=>{const t={expiration:"number"==typeof e.header.expiration?e.header.expiration:Zi(e.header.expiration),ref_block_num:e.header.refBlockNum,ref_block_prefix:e.header.refBlockPrefix,max_net_usage_words:e.header.maxNetUsageWords,max_cpu_usage_ms:e.header.maxCpuUsageMs,delay_sec:e.header.delaySec},r=[];return e.actions.forEach((e=>{r.push(Xi(e))})),{chain_id:e.chainId,header:t,ack:r}})(e.transaction);this.params={path:t,chain_id:r,header:i,ack:n}}get info(){return"Sign EOS transaction"}async run(){return{signature:(await(async(e,t,r,i,n)=>{const s=await e("EosSignTx","EosTxActionRequest",{address_n:t,chain_id:r,header:i,num_actions:n.length});return Qi(e,s.message,n,0)})(this.device.getCommands().typedCall.bind(this.device.getCommands()),this.params.path,this.params.chain_id,this.params.header,this.params.ack)).signature}}}const tn=(e,t)=>{if(t){const r=t.name.toLowerCase().indexOf("testnet")>=0?"Testnet":t.name;return e.replace("#NETWORK",r)}return e.replace("#NETWORK","")};var rn=__webpack_require__("../protocol/lib/index.js"),nn=__webpack_require__("../protobuf/lib/index.js");const sn=async({chainId:e,slip44:t,contractAddress:r})=>{const i={};if(!e&&!t)throw new Error("argument chainId or slip44 is required");try{const r=`https://data.trezor.io/firmware/eth-definitions/${e?"chain-id":"slip44"}/${e??t}/network.dat`,n=await o()(r);if(200===n.status)i.encoded_network=await n.arrayBuffer();else if(404!==n.status)throw new Error(`unexpected status: $${n.status}`)}catch(t){console.warn(`unable to download or parse ${e} definition. detail: ${t.message}`)}try{if(r){const n=`https://data.trezor.io/firmware/eth-definitions/${e?"chain-id":"slip44"}/${e??t}/token-${r.toLowerCase()}.dat`,s=await o()(n);if(200===s.status)i.encoded_token=await s.arrayBuffer();else if(404!==s.status)throw new Error(`unexpected status: $${s.status}`)}}catch(t){console.warn(`unable to download or parse ${e}/${r} definition. detail: ${t.message}`)}return i},on=e=>{const t={network:void 0,token:void 0};return["encoded_token","encoded_network"].forEach((r=>{const i=e[r];if(!i)return;const{definitionType:n,protobufPayload:s}=rn.trzd.decode(i),o=he.getProtobufMessages(),a=0===n?"EthereumNetworkInfo":"EthereumTokenInfo",u=(0,nn.parseConfigure)(o).lookupType(a),h=(0,nn.decode)(u,s);"encoded_network"===r?(It(h,[{name:"chain_id",type:"number",required:!0},{name:"name",type:"string",required:!0},{name:"slip44",type:"number",required:!0},{name:"symbol",type:"string",required:!0}]),t.network=h):"encoded_token"===r&&(It(h,[{name:"address",type:"string",required:!0},{name:"chain_id",type:"number",required:!0},{name:"name",type:"string",required:!0},{name:"decimals",type:"number",required:!0},{name:"symbol",type:"string",required:!0}]),t.token=h)})),t},an=e=>({...G,chainId:e.chain_id,label:e.name,name:e.name,slip44:e.slip44,shortcut:e.symbol,support:{connect:!0,trezor1:"1.6.2",trezor2:"2.0.7"},blockchainLink:void 0});class un extends St{progress=0;init(){this.requiredPermissions=["read"],this.hasBundle=!!this.payload.bundle;const e=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};It(e,[{name:"bundle",type:"array"},{name:"useEventListener",type:"boolean"}]),this.params=e.bundle.map((e=>{It(e,[{name:"path",required:!0},{name:"address",type:"string"},{name:"showOnTrezor",type:"boolean"}]);const t=x(e.path,3),r=L(t);return this.firmwareRange=At(this.name,r,this.firmwareRange),{address_n:t,show_display:"boolean"!=typeof e.showOnTrezor||e.showOnTrezor,address:e.address,network:r}}));const t=e.useEventListener&&1===this.params.length&&"string"==typeof this.params[0].address&&this.params[0].show_display;this.confirmed=t,this.useUi=!t}async initAsync(){for(let e=0;ee.network)),t=$(e);return 1===t.length&&t[0]?tn("Export multiple #NETWORK addresses",t[0]):"Export multiple addresses"}getButtonRequestData(e){if("ButtonRequest_Address"===e)return{type:"address",serializedPath:R(this.params[this.progress].address_n),address:this.params[this.progress].address||"not-set"}}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:this.info}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async noBackupConfirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await e.promise).payload}_call({address_n:e,show_display:t,encoded_network:r}){return this.device.getCommands().ethereumGetAddress({address_n:e,show_display:t,encoded_network:r})}async run(){const e=[];for(let t=0;t{It(e,[{name:"path",required:!0},{name:"showOnTrezor",type:"boolean"}]);const t=x(e.path,3),r=L(t);return this.firmwareRange=At(this.name,r,this.firmwareRange),{address_n:t,show_display:"boolean"==typeof e.showOnTrezor&&e.showOnTrezor,network:r}}))}get info(){if(1===this.params.length)return tn("Export #NETWORK public key",this.params[0].network);const e=this.params.map((e=>e.network)),t=$(e);return 1===t.length&&t[0]?tn("Export multiple #NETWORK public keys",t[0]):"Export multiple public keys"}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-xpub",label:this.info}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async run(){const e=[],t=this.device.getCommands();for(let r=0;r{if(null==e)return["",""];return[e.slice(0,t),e.slice(t)]},pn=async(e,t,r,i)=>{if(!t.data_length){let e=t.signature_v;const r=t.signature_r,n=t.signature_s;if(null==e||null==r||null==n)throw g("Runtime","processTxRequest: Unexpected request");return i&&e<=1&&(e+=2*i+35),cn.resolve({v:`0x${e.toString(16)}`,r:`0x${r}`,s:`0x${n}`})}const[n,s]=fn(r,2*t.data_length),o=await e("EthereumTxAck","EthereumTxRequest",{data_chunk:n});return pn(e,o.message,s,i)},mn=e=>{for(;/^00/.test(e);)e=e.slice(2);return e},bn=e=>{if("string"==typeof e){let t=ci(e);return t.length%2!=0&&(t=`0${t}`),t}return Array.isArray(e)?e.map(bn):"object"==typeof e?Object.entries(e).reduce(((e,[t,r])=>({...e,[t]:bn(r)})),{}):e};class gn extends St{init(){this.requiredPermissions=["read","write"];const{payload:e}=this;It(e,[{name:"path",required:!0},{name:"transaction",required:!0}]);const t=x(e.path,3),r=L(t),i=e.transaction,n=i.maxFeePerGas&&i.maxPriorityFeePerGas;this.firmwareRange=At(n?"eip1559":this.name,r,this.firmwareRange);It(i,n?[{name:"to",type:"string",required:!0},{name:"value",type:"string",required:!0},{name:"gasLimit",type:"string",required:!0},{name:"maxFeePerGas",type:"string",required:!0},{name:"maxPriorityFeePerGas",type:"string",required:!0},{name:"nonce",type:"string",required:!0},{name:"data",type:"string"},{name:"chainId",type:"number",required:!0}]:[{name:"to",type:"string",required:!0},{name:"value",type:"string",required:!0},{name:"gasLimit",type:"string",required:!0},{name:"gasPrice",type:"string",required:!0},{name:"nonce",type:"string",required:!0},{name:"data",type:"string"},{name:"chainId",type:"number"},{name:"txType",type:"number"}]),"number"!=typeof i.chainId&&console.warn("TrezorConnect.ethereumSignTransaction: Missing chainId parameter!"),this.params={path:t,tx:{type:n?"eip1559":"legacy",...bn(i)},network:r}}async initAsync(){if(1===this.params.tx.chainId&&!this.params.tx.data)return;const e=M(this.params.path),t=await sn({chainId:this.params.tx.chainId,slip44:e,contractAddress:this.params.tx.data?this.params.tx.to:void 0});this.params.definitions=t;const r=on(t);r.network&&(this.params.network=an(r.network))}get info(){return tn("Sign #NETWORK transaction",this.params.network)}run(){const{tx:e,definitions:t}=this.params;return"eip1559"===e.type?(async(e,t,r,i,n,s,o,a,u,h,l,d)=>{const c=null==h?0:h.length/2,[f,p]=fn(h,2048),m={address_n:t,nonce:mn(a),max_gas_fee:mn(s),max_priority_fee:mn(o),gas_limit:mn(n),to:r,value:mn(i),data_length:c,data_initial_chunk:f,chain_id:u,access_list:(l||[]).map((e=>({address:e.address,storage_keys:e.storageKeys}))),definitions:d},b=await e("EthereumSignTxEIP1559","EthereumTxRequest",m);return pn(e,b.message,p)})(this.device.getCommands().typedCall.bind(this.device.getCommands()),this.params.path,e.to,e.value,e.gasLimit,e.maxFeePerGas,e.maxPriorityFeePerGas,e.nonce,e.chainId,e.data,e.accessList,t):(async(e,t,r,i,n,s,o,a,u,h,l)=>{const d=null==u?0:u.length/2,[c,f]=fn(u,2048);let p={address_n:t,chain_id:a,nonce:mn(o),gas_price:mn(s),gas_limit:mn(n),to:r,value:mn(i),definitions:l};0!==d&&(p={...p,data_length:d,data_initial_chunk:c}),null!==h&&(p={...p,tx_type:h});const m=await e("EthereumSignTx","EthereumTxRequest",p);return pn(e,m.message,f,a)})(this.device.getCommands().typedCall.bind(this.device.getCommands()),this.params.path,e.to,e.value,e.gasLimit,e.gasPrice,e.nonce,e.chainId,e.data,e.txType,t)}}var yn=__webpack_require__("../../node_modules/buffer/index.js").Buffer;const vn=new RegExp(/^(.*)\[([0-9]*)\]$/),wn=new RegExp(/^bytes([0-9]*)$/),_n=new RegExp(/^(u?int)([0-9]*)$/);function Mn(e){const t=vn.exec(e);if(null===t)throw g("Runtime",`typename ${e} could not be parsed as an EIP-712 array`);const[r,i,n]=t;return{entryTypeName:i,arraySize:parseInt(n,10)||null}}function En(e,t,r){let i=new Er(e);if(r&&(i=function(e,t){if(t<1||t>32)throw g("Runtime","Int byte size must be between 1 and 32 (8 and 256 bits)");const r=new Er(2).exponentiatedBy(8*t-1).negated(),i=r.negated().minus(1),n=new Er(e);if(n.isGreaterThan(i)||n.isLessThan(r))throw g("Runtime",`Overflow when trying to convert number ${e} into ${t} bytes`);return n.isPositive()?n:n.minus(r).minus(r)}(i,t)),i.isNegative())throw g("Runtime",`Cannot convert negative number to unsigned interger: ${e}`);const n=i.toString(16),s=2*t;if(n.length>s)throw g("Runtime",`Overflow when trying to convert number ${e} into ${t} bytes`);return n.padStart(2*t,"0")}function Sn(e,t){if(wn.test(e)||"address"===e)return fi(t);if("string"===e)return yn.from(t,"utf-8").toString("hex");const r=_n.exec(e);if(r){const[e,i,n]=r;return En(t,Math.ceil(parseInt(n,10)/8),"int"===i)}if("bool"===e)return t?"01":"00";throw g("Runtime",`Unsupported data type for direct field encoding: ${e}`)}const Tn={string:Je.EthereumDataType.STRING,bool:Je.EthereumDataType.BOOL,address:Je.EthereumDataType.ADDRESS};function In(e,t){const r=vn.exec(e);if(r){const[e,i,n]=r,s=In(i,t);return{data_type:Je.EthereumDataType.ARRAY,size:parseInt(n,10)||void 0,entry_type:s}}const i=_n.exec(e);if(i){const[e,t,r]=i;return{data_type:"uint"===t?Je.EthereumDataType.UINT:Je.EthereumDataType.INT,size:Math.floor(parseInt(r,10)/8)}}const n=wn.exec(e);if(n){const[e,t]=n;return{data_type:Je.EthereumDataType.BYTES,size:parseInt(t,10)||void 0}}const s=Tn[e];if(s)return{data_type:s};if(e in t)return{data_type:Je.EthereumDataType.STRUCT,size:t[e].length,struct_name:e};throw g("Runtime",`No type definition specified: ${e}`)}class On extends St{init(){this.requiredPermissions=["read","write"];const{payload:e}=this;It(e,[{name:"path",required:!0},{name:"metamask_v4_compat",type:"boolean",required:!0},{name:"data",type:"object",required:!0},{name:"domain_separator_hash",type:"string"},{name:"message_hash",type:"string"}]);const t=x(e.path,3),r=L(t);if(this.firmwareRange=At(this.name,r,this.firmwareRange),this.params={address_n:t,metamask_v4_compat:e.metamask_v4_compat,data:e.data,network:r},e.domain_separator_hash)if(this.params={...this.params,domain_separator_hash:fi(e.domain_separator_hash)},e.message_hash)this.params={...this.params,message_hash:fi(e.message_hash)};else if("EIP712Domain"!==this.params.data.primaryType)throw g("Method_InvalidParameter","message_hash should only be empty when data.primaryType=EIP712Domain");if("EIP712Domain"===this.params.data.primaryType&&(this.firmwareRange=At("eip712-domain-only",r,this.firmwareRange),"message_hash"in this.params))throw g("Method_InvalidParameter","message_hash should be empty when data.primaryType=EIP712Domain")}async initAsync(){if(this.params.network)return;const{address_n:e}=this.params,t=M(e);this.params.definitions=await sn({slip44:t})}get info(){return tn("Sign #NETWORK typed data",L(this.params.address_n))}async run(){const e=this.device.getCommands(),{address_n:t,definitions:r}=this.params;if(this.device.features.internal_model===Je.DeviceModelInternal.T1B1){It(this.params,[{name:"domain_separator_hash",type:"string",required:!0},{name:"message_hash",type:"string"}]);const{domain_separator_hash:i,message_hash:n}=this.params,s=await e.typedCall("EthereumSignTypedHash","EthereumTypedDataSignature",{address_n:t,domain_separator_hash:i,message_hash:n,encoded_network:r?.encoded_network}),{address:o,signature:a}=s.message;return{address:o,signature:`0x${a}`}}const{data:i,metamask_v4_compat:n}=this.params,{types:s,primaryType:o,domain:a,message:u}=i;let h=await e.typedCall("EthereumSignTypedData",["EthereumTypedDataStructRequest","EthereumTypedDataValueRequest","EthereumTypedDataSignature"],{address_n:t,primary_type:o,metamask_v4_compat:n,definitions:r});for(;"EthereumTypedDataStructRequest"===h.type;){const{name:t}=h.message,r=s[t];if(void 0===r)throw g("Runtime",`Type ${t} was not defined in types object`);const i={members:r.map((({name:e,type:t})=>({name:e,type:In(t,s)})))};h=await e.typedCall("EthereumTypedDataStructAck",["EthereumTypedDataStructRequest","EthereumTypedDataValueRequest","EthereumTypedDataSignature"],i)}for(;"EthereumTypedDataValueRequest"===h.type;){const{member_path:t}=h.message;let r,i;const[n,...l]=t;switch(n){case 0:r=a,i="EIP712Domain";break;case 1:r=u,i=o;break;default:throw g("Runtime","Root index can only be 0 or 1")}for(const e of l)if(Array.isArray(r))i=Mn(i).entryTypeName,r=r[e];else if("object"==typeof r&&null!==r){const t=s[i][e];i=t.type,r=r[t.name]}let d;d=Array.isArray(r)?Sn("uint16",r.length):Sn(i,r),h=await e.typedCall("EthereumTypedDataValueAck",["EthereumTypedDataValueRequest","EthereumTypedDataSignature"],{value:d})}const{address:l,signature:d}=h.message;return{address:l,signature:`0x${d}`}}}var An=__webpack_require__("../../node_modules/buffer/index.js").Buffer;class jn extends St{init(){this.requiredPermissions=["read","write"],this.firmwareRange=At(this.name,null,this.firmwareRange);const{payload:e}=this;It(e,[{name:"address",type:"string",required:!0},{name:"signature",type:"string",required:!0},{name:"message",type:"string",required:!0},{name:"hex",type:"boolean"}]);const t=e.hex?fi(e.message):An.from(e.message,"utf8").toString("hex");this.params={address:ci(e.address),signature:ci(e.signature),message:t}}get info(){return"Verify message"}async run(){const e=this.device.getCommands();return(await e.typedCall("EthereumVerifyMessage","Success",this.params)).message}}const kn=e=>{const t=new Uint8Array(e);return"TRZR"===String.fromCharCode(...Array.from(t.slice(0,4)))&&"TRZF"===String.fromCharCode(...Array.from(t.slice(256,260)))?e.slice(256):e},xn=e=>{e.features.firmware_present&&e.emit(ge,e,{code:"ButtonRequest_FirmwareUpdate"})},Rn=(e,t,r)=>{r(Ye(Xe.FIRMWARE_PROGRESS,{device:e.toMessageObject(),progress:t}))};var Pn=__webpack_require__("../../node_modules/blakejs/index.js"),Nn=__webpack_require__("../../node_modules/buffer/index.js").Buffer;const Cn=(e,t,r)=>{const i=1===e?983040:1703936,n=i-t.byteLength;if(n<0)throw new Error("Firmware too big");const s=new Uint8Array(new ArrayBuffer(i));if(s.set(new Uint8Array(t)),n>0){const e=Nn.alloc(n);e.fill(Nn.from("ff","hex")),s.set(e,t.byteLength)}return{hash:r&&r.length>0?(0,Pn.blake2sHex)(s,r):(0,Pn.blake2sHex)(s),challenge:r?r.toString("hex"):""}};class Bn extends St{init(){this.useEmptyPassphrase=!0,this.requiredPermissions=["management"],this.allowDeviceMode=[Xe.BOOTLOADER,Xe.INITIALIZE],this.requireDeviceMode=[Xe.BOOTLOADER],this.useDeviceState=!1,this.skipFirmwareCheck=!0;const{payload:e}=this;It(e,[{name:"version",type:"array"},{name:"btcOnly",type:"boolean"},{name:"baseUrl",type:"string"},{name:"binary",type:"array-buffer"},{name:"intermediaryVersion",type:"number"}]),"version"in e&&(this.params={version:e.version,btcOnly:e.btcOnly,baseUrl:e.baseUrl||"https://data.trezor.io",intermediaryVersion:e.intermediaryVersion}),"binary"in e&&(this.params={...this.params,binary:e.binary})}async confirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"device-management",customConfirmButton:{className:"wipe",label:"Proceed"},label:"Do you want to update firmware? Never do this without your recovery card."}));return(await e.promise).payload}async run(){const{device:e,params:t}=this;let r;try{r=t.binary?t.binary:await(({features:e,releases:t,baseUrl:r,version:i,btcOnly:s,intermediaryVersion:o})=>{if(!Z(e))throw new Error("Features of unexpected shape provided");if(o)return a(`${r}/firmware/1/trezor-inter-v${o}.bin`,"binary");const u=ie({features:e,releases:t}),h=t.find((e=>i&&n.versionUtils.isVersionArray(i)&&n.versionUtils.isEqual(e.version,i)));if(!u||!h)throw new Error("no firmware found for this device");if(s&&!h.url_bitcoinonly)throw new Error(`firmware version ${i} does not exist in btc only variant`);if(!n.versionUtils.isEqual(h.version,u.release.version))throw new Error("version provided as param does not match firmware version found by features in bootloader");const l=h[s?"url_bitcoinonly":"url"];return a(`${r}/${l}`,"binary")})({features:e.features,releases:ne(e.features.major_version),version:t.version,btcOnly:t.btcOnly,baseUrl:t.baseUrl,intermediaryVersion:t.intermediaryVersion})}catch(e){throw g("Method_FirmwareUpdate_DownloadFailed",`Failed to download firmware binary ${e.message}`)}const i=kn(r);var s;return await(async(e,t,r,{payload:i})=>{if(1===r.features.major_version){xn(r),await e("FirmwareErase","Success",{}),Rn(r,0,t);const{message:n}=await e("FirmwareUpload","Success",{payload:i});return Rn(r,100,t),n}if(2===r.features.major_version){xn(r);const n=i.byteLength;let s=await e("FirmwareErase",["FirmwareRequest","Success"],{length:n});for(;"Success"!==s.type;){const o=s.message.offset,a=s.message.offset+s.message.length,u=i.slice(o,a);o>0&&Rn(r,Math.round(o/n*100),t),s=await e("FirmwareUpload",["FirmwareRequest","Success"],{payload:u})}return Rn(r,100,t),s.message}throw g("Runtime","uploadFirmware: unknown major_version")})(this.device.getCommands().typedCall.bind(this.device.getCommands()),this.postMessage,e,{payload:(s=e.features,2!==s.major_version&&n.versionUtils.isNewerOrEqual([s.major_version,s.minor_version,s.patch_version],[1,8,0])?i:r)}),Cn(e.features.major_version,i,(0,Ee.O6)(32))}}var Un=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;class Dn extends St{disposed=!1;init(){this.requiredPermissions=["read"],this.useDevice=!0,this.useUi=!0;let e=!1;this.hasBundle=!!this.payload.bundle;const t=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};It(t,[{name:"bundle",type:"array"}]),this.params=t.bundle.map((r=>{It(r,[{name:"coin",type:"string",required:!0},{name:"descriptor",type:"string"},{name:"path",type:"string"},{name:"details",type:"string"},{name:"tokens",type:"string"},{name:"page",type:"number"},{name:"pageSize",type:"number"},{name:"from",type:"number"},{name:"to",type:"number"},{name:"contractFilter",type:"string"},{name:"gap",type:"number"},{name:"marker",type:"object"},{name:"defaultAccountType",type:"string"},{name:"derivationType",type:"number"},{name:"suppressBackupWarning",type:"boolean"}]);const i=V(r.coin);if(!i)throw g("Method_UnknownCoin");er(i);let n=[];if(r.path&&(n=x(r.path,3),e="string"!=typeof r.descriptor),!r.path&&!r.descriptor){if(t.bundle.length>1)throw Error("Discovery for multiple coins in not supported");e=!0}return this.firmwareRange=At(this.name,i,this.firmwareRange),{...r,address_n:n,coinInfo:i}})),this.useDevice=e,this.useUi=e}get info(){return"Export account info"}async confirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);if(1!==this.params.length||this.params[0].path||this.params[0].descriptor){const e={};this.params.forEach((t=>{e[t.coinInfo.label]||(e[t.coinInfo.label]={coinInfo:t.coinInfo,values:[]}),e[t.coinInfo.label].values.push(t.descriptor||t.address_n)}));const t=[];Object.keys(e).forEach(((r,i,n)=>{const s=e[r];s.values.forEach((e=>{t.push(""),t.push(r),t.push(" "),"string"==typeof e?t.push(e):t.push(((e,t)=>{if("bitcoin"===t.type){const r=_(e[0]),i=_(e[2]);let n="";return 48===r?n="multisig":49===r&&t.segwit?n="segwit":44===r&&t.segwit&&(n="legacy"),`${n} account #${i+1}`}return`account #${_(e[4])+1}`})(e,s.coinInfo)),t.push("")}))})),this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-account-info",label:`Export info for: ${t.join("")}`}))}else this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-account-info",label:`Export info for ${this.params[0].coinInfo.label} account of your selection`,customConfirmButton:{label:"Proceed to account selection",className:"not-empty-css"}}));return(await e.promise).payload}async noBackupConfirmation(e){if(e&&this.params.every((e=>e.suppressBackupWarning)))return!0;await this.getPopupPromise().promise;const t=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await t.promise).payload}async checkFirmwareRange(e){if(e||1===this.params.length)return super.checkFirmwareRange(e);const t={1:{min:"1.0.0",max:"0"},2:{min:"2.0.0",max:"0"}},r=[];for(let e=0;e0)throw g("Method_Discovery_BundleException",JSON.stringify(r))}async run(){if(1===this.params.length&&!this.params[0].path&&!this.params[0].descriptor)return this.discover(this.params[0]);const e=[],t=(e,t,r)=>{!this.hasBundle||this.device&&this.device.getCommands().disposed||this.postMessage(Ye(Xe.BUNDLE_PROGRESS,{progress:e,response:t,error:r}))};for(let r=0;r[])):this.hasBundle?e:e[0]}async discover(e){const{coinInfo:t,defaultAccountType:r}=e,i=await tr(t,this.postMessage),n=this.createUiPromise(Xe.RECEIVE_ACCOUNT),s=new pi({blockchain:i,commands:this.device.getCommands(),derivationType:void 0!==e.derivationType?e.derivationType:Je.CardanoDerivationType.ICARUS_TREZOR});s.on("progress",(e=>{this.postMessage(Ye(Xe.SELECT_ACCOUNT,{type:"progress",coinInfo:t,accounts:e}))})),s.on("complete",(()=>{this.postMessage(Ye(Xe.SELECT_ACCOUNT,{type:"end",coinInfo:t}))})),s.start().catch((e=>{n.reject(e)})),this.postMessage(Ye(Xe.SELECT_ACCOUNT,{type:"start",accountTypes:s.types.map((e=>e.type)),defaultAccountType:r,coinInfo:t}));const o=await n.promise;s.stop();const a=s.accounts[o.payload];s.completed||await ut(501).promise;const u=await i.getAccountInfo({descriptor:a.descriptor,details:e.details,tokens:e.tokens,page:e.page,pageSize:e.pageSize,from:e.from,to:e.to,contractFilter:e.contractFilter,gap:e.gap,marker:e.marker});let h;return Ne(t)&&"string"==typeof e.details&&"basic"!==e.details&&(h=await i.getAccountUtxo(a.descriptor)),{path:R(a.address_n),...u,utxo:h}}dispose(){this.disposed=!0;const{discovery:e}=this;e&&(e.removeAllListeners(),e.stop())}}class Ln extends St{progress=0;init(){this.requiredPermissions=["read"],this.hasBundle=!!this.payload.bundle;const e=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};It(e,[{name:"bundle",type:"array"},{name:"useEventListener",type:"boolean"}]),this.params=e.bundle.map((e=>{It(e,[{name:"path",required:!0},{name:"coin",type:"string"},{name:"address",type:"string"},{name:"showOnTrezor",type:"boolean"},{name:"multisig",type:"object"},{name:"scriptType",type:"string"},{name:"unlockPath",type:"object"}]),e.unlockPath&&It(e.unlockPath,[{name:"address_n",required:!0,type:"array"},{name:"mac",required:!0,type:"string"}]);const t=x(e.path,1);let r;if(e.coin&&(r=D(e.coin)),r&&!e.crossChain?Ot(t,r):r||(r=D(t)),!r)throw g("Method_UnknownCoin");return r&&(this.firmwareRange=At(this.name,r,this.firmwareRange)),r=H(r,t),{address_n:t,address:e.address,show_display:"boolean"!=typeof e.showOnTrezor||e.showOnTrezor,multisig:e.multisig,script_type:e.scriptType,coinInfo:r,unlockPath:e.unlockPath}}));const t=e.useEventListener&&1===this.params.length&&"string"==typeof this.params[0].address&&this.params[0].show_display;this.confirmed=t,this.useUi=!t}get info(){if(1===this.params.length)return N("Export #NETWORK address",this.params[0].coinInfo);const e=this.params.map((e=>e.coinInfo)),t=$(e);return 1===t.length&&t[0]?N("Export multiple #NETWORK addresses",t[0]):"Export multiple addresses"}getButtonRequestData(e){if("ButtonRequest_Address"===e)return{type:"address",serializedPath:R(this.params[this.progress].address_n),address:this.params[this.progress].address||"not-set"}}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:this.info}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async noBackupConfirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await e.promise).payload}async _call({address_n:e,show_display:t,multisig:r,script_type:i,coinInfo:n,unlockPath:s}){const o=this.device.getCommands();return s&&await o.unlockPath(s),o.getAddress({address_n:e,show_display:t,multisig:r,script_type:i},n)}async run(){const e=[];for(let t=0;t{It(e,[{name:"path",required:!0},{name:"coin",type:"string"},{name:"multisig",type:"object"},{name:"scriptType",type:"string"}]);const t=x(e.path,1),r=D(e.coin||t),i=e.scriptType||j(t);return this.firmwareRange=At(this.name,r,this.firmwareRange),{address_n:t,coin_name:r?r.name:void 0,multisig:e.multisig,script_type:i}}))}get info(){return"Export ownership id"}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION,this.device);let t=this.info;this.params.length>1&&(t="Export multiple ownership proof ids"),this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:t}));const r=await e.promise;return this.confirmed=r.payload,this.confirmed}async run(){const e=[],t=this.device.getCommands();for(let r=0;r{It(e,[{name:"path",required:!0},{name:"coin",type:"string"},{name:"multisig",type:"object"},{name:"scriptType",type:"string"},{name:"userConfirmation",type:"boolean"},{name:"ownershipIds",type:"array"},{name:"commitmentData",type:"string"},{name:"preauthorized",type:"boolean"}]);const t=x(e.path,1),r=D(e.coin||t),i=e.scriptType||j(t);return this.firmwareRange=At(this.name,r,this.firmwareRange),e.preauthorized&&(this.preauthorized=e.preauthorized),{address_n:t,coin_name:r?r.name:void 0,multisig:e.multisig,script_type:i,user_confirmation:e.userConfirmation,ownership_ids:e.ownershipIds,commitment_data:e.commitmentData}}))}get info(){return"Export ownership proof"}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION,this.device);let t=this.info;this.params.length>1&&(t="Export multiple ownership proofs"),this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:t}));const r=await e.promise;return this.confirmed=r.payload,this.confirmed}async run(){const e=[],t=this.device.getCommands();for(let r=0;r{let t;It(e,[{name:"path",required:!0},{name:"coin",type:"string"},{name:"crossChain",type:"boolean"},{name:"showOnTrezor",type:"boolean"},{name:"scriptType",type:["string","number"]},{name:"ignoreXpubMagic",type:"boolean"},{name:"ecdsaCurveName",type:"boolean"},{name:"unlockPath",type:"object"},{name:"suppressBackupWarning",type:"boolean"}]),e.unlockPath&&It(e.unlockPath,[{name:"address_n",required:!0,type:"array"},{name:"mac",required:!0,type:"string"}]),e.coin&&(t=D(e.coin));const r=x(e.path,t?3:0);return t&&!e.crossChain?Ot(r,t):t||(t=D(r)),t&&(this.firmwareRange=At(this.name,t,this.firmwareRange)),{address_n:r,coin_name:t?.name,show_display:e.showOnTrezor,script_type:e.scriptType,ignore_xpub_magic:e.ignoreXpubMagic,ecdsa_curve_name:e.ecdsaCurveName,coinInfo:t,unlockPath:e.unlockPath,suppress_backup_warning:e.suppressBackupWarning}}))}get info(){return"Export public key"}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);let t;t=this.params.length>1?"Export multiple public keys":Pe(this.params[0].address_n,this.params[0].coinInfo),this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-xpub",label:t}));const r=await e.promise;return this.confirmed=r.payload,this.confirmed}async noBackupConfirmation(e){if(e&&this.params.every((e=>e.suppressBackupWarning||!e.show_display)))return!0;await this.getPopupPromise().promise;const t=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await t.promise).payload}async run(){const e=[],t=this.device.getCommands();for(let r=0;r{It(e,[{name:"path",required:!0},{name:"address",type:"string"},{name:"network",type:"number"},{name:"showOnTrezor",type:"boolean"}]);return{address_n:x(e.path,3),network:e.network||104,show_display:"boolean"!=typeof e.showOnTrezor||e.showOnTrezor,address:e.address}}));const t=e.useEventListener&&1===this.params.length&&"string"==typeof this.params[0].address&&this.params[0].show_display;this.confirmed=t,this.useUi=!t}get info(){if(1===this.params.length){let e="Unknown";switch(this.params[0].network){case 104:e="Mainnet";break;case 152:e="Testnet";break;case 96:e="Mijin"}return`Export NEM address for account #${_(this.params[0].address_n[2])+1} on ${e} network`}return"Export multiple NEM addresses"}getButtonRequestData(e){if("ButtonRequest_Address"===e)return{type:"address",serializedPath:R(this.params[this.progress].address_n),address:this.params[this.progress].address||"not-set"}}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:this.info}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async noBackupConfirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await e.promise).payload}async _call({address_n:e,network:t,show_display:r}){const i=this.device.getCommands();return(await i.typedCall("NEMGetAddress","NEMAddress",{address_n:e,network:t,show_display:r})).message}async run(){const e=[];for(let t=0;t({address_n:t,network:e.version>>24&255,timestamp:e.timeStamp,fee:e.fee,deadline:e.deadline,signer:t?void 0:e.signer}),ts=(e,t)=>{let r=e;const i={transaction:es(e,t),transfer:void 0,importance_transfer:void 0,aggregate_modification:void 0,provision_namespace:void 0,mosaic_creation:void 0,supply_change:void 0};switch(e.type!==Qn.COSIGNING&&e.type!==Qn.MULTISIG&&e.type!==Qn.MULTISIG_SIGNATURE||(i.cosigning=e.type===Qn.COSIGNING||e.type===Qn.MULTISIG_SIGNATURE,r=e.otherTrans,i.multisig=es(r)),r.type){case Qn.TRANSFER:i.transfer=(e=>{const t=e.mosaics?e.mosaics.map((e=>({namespace:e.mosaicId.namespaceId,mosaic:e.mosaicId.name,quantity:e.quantity}))):void 0;return{recipient:e.recipient,amount:e.amount,payload:e.message?e.message.payload:void 0,public_key:e.message&&2===e.message.type?e.message.publicKey:void 0,mosaics:t}})(r);break;case Qn.IMPORTANCE_TRANSFER:i.importance_transfer=(e=>({mode:e.importanceTransfer.mode,public_key:e.importanceTransfer.publicKey}))(r);break;case Qn.AGGREGATE_MODIFICATION:i.aggregate_modification=(e=>({modifications:e.modifications?e.modifications.map((e=>({type:e.modificationType,public_key:e.cosignatoryAccount}))):void 0,relative_change:e.minCosignatories.relativeChange}))(r);break;case Qn.PROVISION_NAMESPACE:i.provision_namespace=(e=>({namespace:e.newPart,parent:e.parent,sink:e.rentalFeeSink,fee:e.rentalFee}))(r);break;case Qn.MOSAIC_CREATION:i.mosaic_creation=(e=>{const{levy:t}=e.mosaicDefinition,r={namespace:e.mosaicDefinition.id.namespaceId,mosaic:e.mosaicDefinition.id.name,levy:t&&t.type,fee:t&&t.fee,levy_address:t&&t.recipient,levy_namespace:t&&t.mosaicId&&t.mosaicId.namespaceId,levy_mosaic:t&&t.mosaicId&&t.mosaicId.name,description:e.mosaicDefinition.description},{properties:i}=e.mosaicDefinition;return Array.isArray(i)&&i.forEach((e=>{const{name:t,value:i}=e;switch(t){case"divisibility":r.divisibility=parseInt(i,10);break;case"initialSupply":r.supply=parseInt(i,10);break;case"supplyMutable":r.mutable_supply="true"===i;break;case"transferable":r.transferable="true"===i}})),{definition:r,sink:e.creationFeeSink,fee:e.creationFee}})(r);break;case Qn.SUPPLY_CHANGE:i.supply_change=(e=>({namespace:e.mosaicId.namespaceId,mosaic:e.mosaicId.name,type:e.supplyType,delta:e.delta}))(r);break;default:throw g("Method_InvalidParameter","Unknown transaction type")}return i};class rs extends St{init(){this.requiredPermissions=["read","write"],this.firmwareRange=At(this.name,q("NEM"),this.firmwareRange);const{payload:e}=this;It(e,[{name:"path",required:!0},{name:"transaction",required:!0}]);const t=x(e.path,3);this.params=ts(e.transaction,t)}get info(){return"Sign NEM transaction"}async run(){const e=this.device.getCommands();return(await e.typedCall("NEMSignTx","NEMSignedTx",this.params)).message}}class is extends St{init(){this.requiredPermissions=[],this.useUi=!1,this.useDevice=!1;const{payload:e}=this;It(e,[{name:"tx",type:"string",required:!0},{name:"coin",type:"string",required:!0}]);const t=V(e.coin);if(!t)throw g("Method_UnknownCoin");if(er(t),"bitcoin"===t.type&&!/^[0-9A-Fa-f]*$/.test(e.tx))throw g("Method_InvalidParameter","Transaction must be hexadecimal");this.params={tx:e.tx,coinInfo:t}}async run(){const e=await tr(this.params.coinInfo,this.postMessage);return{txid:await e.pushTransaction(this.params.tx)}}}class ns extends St{init(){this.allowDeviceMode=[Xe.INITIALIZE,Xe.SEEDLESS],this.skipFinalReload=!0,this.keepSession=!1,this.requiredPermissions=["management"],this.useDeviceState=!1,this.firmwareRange=At(this.name,null,{1:{min:"1.10.0",max:"0"},2:{min:"2.6.0",max:"0"}})}get info(){return"Reboot to bootloader"}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"device-management",customConfirmButton:{className:"confirm",label:"Reboot"},label:"Are you sure you want to reboot to bootloader?"}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async run(){const e=this.device.getCommands();return(await e.typedCall("RebootToBootloader","Success")).message}}class ss extends St{init(){this.requiredPermissions=["management"],this.useEmptyPassphrase=!0;const{payload:e}=this;It(e,[{name:"word_count",type:"number"},{name:"passphrase_protection",type:"boolean"},{name:"pin_protection",type:"boolean"},{name:"language",type:"string"},{name:"label",type:"string"},{name:"enforce_wordlist",type:"boolean"},{name:"type",type:"number"},{name:"u2f_counter",type:"number"},{name:"dry_run",type:"boolean"}]),this.params={word_count:e.word_count,passphrase_protection:e.passphrase_protection,pin_protection:e.pin_protection,language:e.language,label:e.label,enforce_wordlist:e.enforce_wordlist,type:e.type,u2f_counter:e.u2f_counter,dry_run:e.dry_run},this.allowDeviceMode=[...this.allowDeviceMode,Xe.INITIALIZE],this.useDeviceState=!1}async confirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"device-management",customConfirmButton:{className:"confirm",label:"Proceed"},label:"Do you want to recover device from seed?"}));return(await e.promise).payload}async run(){const e=this.device.getCommands();return(await e.typedCall("RecoveryDevice","Success",this.params)).message}}class os extends St{init(){this.requiredPermissions=["read","write"],this.firmwareRange=At(this.name,null,this.firmwareRange),this.useEmptyPassphrase=!0;const{payload:e}=this,t={},r=he.getSettings();if(r.origin){const[e,i,n]=r.origin.split(":");t.proto=e,t.host=i.substring(2),n&&(t.port=n),t.index=0}It(e,[{name:"challengeHidden",type:"string"},{name:"challengeVisual",type:"string"},{name:"asyncChallenge",type:"boolean"}]),this.params={identity:t,challenge_hidden:e.challengeHidden||"",challenge_visual:e.challengeVisual||""},this.asyncChallenge=!!e.asyncChallenge}get info(){return"Login"}async run(){if(this.asyncChallenge){const e=this.createUiPromise(Xe.LOGIN_CHALLENGE_RESPONSE);this.postMessage(Ye(Xe.LOGIN_CHALLENGE_REQUEST));const{payload:t}=await e.promise;if("string"==typeof t)throw g("Runtime",`TrezorConnect.requestLogin callback error: ${t}`);It(t,[{name:"challengeHidden",type:"string",required:!0},{name:"challengeVisual",type:"string",required:!0}]),this.params.challenge_hidden=t.challengeHidden,this.params.challenge_visual=t.challengeVisual}const e=this.device.getCommands(),{message:t}=await e.typedCall("SignIdentity","SignedIdentity",this.params);return{address:t.address,publicKey:t.public_key,signature:t.signature}}}class as extends St{init(){this.allowDeviceMode=[Xe.INITIALIZE,Xe.SEEDLESS],this.useDeviceState=!1,this.requiredPermissions=["management"],this.firmwareRange=At(this.name,null,this.firmwareRange);const{payload:e}=this;It(e,[{name:"display_random",type:"boolean"},{name:"strength",type:"number"},{name:"passphrase_protection",type:"boolean"},{name:"pin_protection",type:"boolean"},{name:"language",type:"string"},{name:"label",type:"string"},{name:"u2f_counter",type:"number"},{name:"skip_backup",type:"boolean"},{name:"no_backup",type:"boolean"},{name:"backup_type",type:"number"}]),this.params={display_random:e.display_random,strength:e.strength||256,passphrase_protection:e.passphrase_protection,pin_protection:e.pin_protection,language:e.language,label:e.label,u2f_counter:e.u2f_counter||Math.floor(Date.now()/1e3),skip_backup:e.skip_backup,no_backup:e.no_backup,backup_type:e.backup_type}}get info(){return"Setup device"}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"device-management",label:"Do you really you want to create a new wallet?"}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async run(){const e=this.device.getCommands();return(await e.typedCall("ResetDevice","Success",this.params)).message}}class us extends St{progress=0;init(){this.requiredPermissions=["read"],this.firmwareRange=At(this.name,q("Ripple"),this.firmwareRange),this.hasBundle=!!this.payload.bundle;const e=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};It(e,[{name:"bundle",type:"array"},{name:"useEventListener",type:"boolean"}]),this.params=e.bundle.map((e=>{It(e,[{name:"path",required:!0},{name:"address",type:"string"},{name:"showOnTrezor",type:"boolean"}]);return{address_n:x(e.path,3),address:e.address,show_display:"boolean"!=typeof e.showOnTrezor||e.showOnTrezor}}));const t=e.useEventListener&&1===this.params.length&&"string"==typeof this.params[0].address&&this.params[0].show_display;this.confirmed=t,this.useUi=!t}get info(){return 1===this.params.length?`Export Ripple address for account #${_(this.params[0].address_n[2])+1}`:"Export multiple Ripple addresses"}getButtonRequestData(e){if("ButtonRequest_Address"===e)return{type:"address",serializedPath:R(this.params[this.progress].address_n),address:this.params[this.progress].address||"not-set"}}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:this.info}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async noBackupConfirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await e.promise).payload}async _call({address_n:e,show_display:t}){const r=this.device.getCommands();return(await r.typedCall("RippleGetAddress","RippleAddress",{address_n:e,show_display:t})).message}async run(){const e=[];for(let t=0;te.map((e=>P(e))).map((e=>xe(t.network,e))).map((e=>(It(e,[{name:"prev_hash",type:"string",required:!0},{name:"prev_index",type:"number",required:!0},{name:"amount",type:"uint",required:"EXTERNAL"===e.script_type||I(e.address_n)},{name:"script_type",type:"string"},{name:"sequence",type:"number"},{name:"multisig",type:"object"},{name:"coinjoin_flags",type:"number"}]),"EXTERNAL"===e.script_type?It(e,[{name:"script_pubkey",type:"string",required:!0},{name:"commitment_data",type:"string"},{name:"ownership_proof",type:"string"},{name:"script_sig",type:"string"},{name:"witness",type:"string"}]):x(e.address_n),e))))(e.inputs,t),i=((e,t)=>{const r=e.map((e=>P(e))).map((e=>xe(t.network,e)));return r.forEach((e=>{if(It(e,[{name:"address_n",type:"array"},{name:"address",type:"string"},{name:"amount",type:"uint"},{name:"op_return_data",type:"string"},{name:"multisig",type:"object"}]),Object.prototype.hasOwnProperty.call(e,"address_n")&&Object.prototype.hasOwnProperty.call(e,"address"))throw g("Method_InvalidParameter","Cannot use address and address_n in one output");if(e.address_n&&!e.script_type&&(e.script_type=k(e.address_n)),"address"in e&&"string"==typeof e.address&&!mi(e.address,t))throw g("Method_InvalidParameter",`Invalid ${t.label} output address ${e.address}`)})),r})(e.outputs,t);e.refTxs&&e.account?.transactions&&console.warn("two sources of referential transactions were passed. payload.refTxs have precedence");const n=Ai({transactions:e.refTxs||e.account?.transactions,inputs:r,outputs:i,coinInfo:t,addresses:e.account?.addresses}),s=i.filter((e=>"string"==typeof e.amount&&!Object.prototype.hasOwnProperty.call(e,"op_return_data")));if(s.length>0){if(s.reduce(((e,t)=>e.plus("string"==typeof t.amount?t.amount:"0")),new Er(0)).lt(t.dustLimit))throw g("Method_InvalidParameter","Total amount is below dust limit.")}this.params={inputs:r,outputs:i,paymentRequests:e.paymentRequests||[],refTxs:n,addresses:e.account?e.account.addresses:void 0,options:{lock_time:e.locktime,timestamp:e.timestamp,version:e.version,expiry:e.expiry,overwintered:e.overwintered,version_group_id:e.versionGroupId,branch_id:e.branchId,decred_staking_ticket:e.decredStakingTicket,amount_unit:e.amountUnit,serialize:e.serialize,coinjoin_request:e.coinjoinRequest},coinInfo:t,push:"boolean"==typeof e.push&&e.push,unlockPath:e.unlockPath},this.params.options=vi(this.params.options,t)}get info(){const e=D(this.payload.coin);return N("Sign #NETWORK transaction",e)}async fetchAddresses(e){const{device:t,params:{inputs:r,coinInfo:i}}=this,n=r.find((e=>e.address_n));if(!n||!n.address_n)throw g("Runtime","Account not found");const s=n.address_n.slice(0,3),o=await t.getCommands().getHDNode({address_n:s},{coinInfo:i});return(await e.getAccountInfo({descriptor:o.xpubSegwit||o.xpub,details:"tokens"})).addresses}async fetchRefTxs(e){const{params:{inputs:t,outputs:r,options:i,coinInfo:n,addresses:s}}=this,o=wi(t,i,n)?_i(t):[],a=e?[]:Mi(t,r);if(!o.length&&!a.length)return[];er(n);const u=await tr(n,this.postMessage),h=o.length?await u.getTransactions(o).then((e=>(((e,t)=>{e.forEach((e=>{if(!e.amount){console.warn("TrezorConnect.singTransaction deprecation: missing input amount.");const r=t.find((t=>"txid"in t.tx&&t.tx.txid===e.prev_hash));r&&"blockbook"===r.type&&r.tx.vout[e.prev_index]&&(e.amount=r.tx.vout[e.prev_index].value)}}))})(this.params.inputs,e),Oi(e,n)))):[],l=a.length?await u.getTransactions(a).then((async e=>{const t=s??await this.fetchAddresses(u);return((e,t,r)=>"bitcoin"===t.type&&r?e.filter(Ti).map((e=>{const i=Te.YW.fromHex(e.tx.hex,{network:t.network});return Si(e.tx,i,r)})):[])(e,n,t)})):[];return h.concat(l)}async run(){const{device:e,params:t}=this,r=!!e.unavailableCapabilities.replaceTransaction,i=t.refTxs??await this.fetchRefTxs(r);this.preauthorized?await e.getCommands().preauthorize(!0):t.unlockPath&&await e.getCommands().unlockPath(t.unlockPath);const n=r?Bi:Ri,s=await n({...t,refTxs:i,typedCall:e.getCommands().typedCall.bind(e.getCommands())});if(!s.serializedTx)return s;let o;if(t.options.decred_staking_ticket?await(async(e,t,r,i,n)=>{const s=Te.YW.fromHex(i,{network:n.network});if(t.length!==s.ins.length)throw g("Runtime","verifyTicketTx: Signed transaction inputs invalid length");if(r.length!==s.outs.length||3!==r.length)throw g("Runtime","verifyTicketTx: Signed transaction outputs invalid length");for(let t=0;to?.getWitness(t)?.toString("hex"))))),o&&t.addresses&&(s.signedTransaction=((e,{addresses:t,inputs:r,outputs:i})=>{const n=i.reduce(((e,t)=>Er(e).plus(t.amount)),new Er("0")),s=r.reduce(((e,t)=>Er(e).plus(t.amount)),new Er("0")),o=t.unused.concat(t.used,t.change),a=({address_n:e})=>{const t=e?R(e):void 0;return o.filter((e=>e.path===t)).map((e=>e.address))};return{txid:e.getId(),hex:e.toHex(),blockHeight:0,blockTime:Math.floor(Date.now()/1e3),confirmations:0,vsize:e.virtualSize(),size:e.weight(),value:n.toString(),valueIn:s.toString(),fees:s.minus(n).toString(),vin:r.map(((e,t)=>({n:t,txid:e.prev_hash,vout:e.prev_index,isAddress:!0,addresses:a(e),value:e.amount.toString(),sequence:e.sequence}))),vout:i.map(((e,t)=>{let r=[];return r=e.address?[e.address]:"op_return_data"in e?[`OP_RETURN (${ps.from(e.op_return_data,"hex").toString("ascii")})`]:a(e),{n:t,isAddress:"PAYTOOPRETURN"!==e.script_type,addresses:r,value:e.amount.toString()}}))}})(o,{addresses:t.addresses,inputs:t.inputs,outputs:t.outputs})),t.push){er(t.coinInfo);const e=await tr(t.coinInfo,this.postMessage),r=await e.pushTransaction(s.serializedTx);return{...s,txid:r}}return s}}class bs extends St{progress=0;init(){this.requiredPermissions=["read"],this.firmwareRange=At(this.name,q("Stellar"),this.firmwareRange),this.hasBundle=!!this.payload.bundle;const e=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};It(e,[{name:"bundle",type:"array"},{name:"useEventListener",type:"boolean"}]),this.params=e.bundle.map((e=>{It(e,[{name:"path",required:!0},{name:"address",type:"string"},{name:"showOnTrezor",type:"boolean"}]);return{address_n:x(e.path,3),address:e.address,show_display:"boolean"!=typeof e.showOnTrezor||e.showOnTrezor}}));const t=e.useEventListener&&1===this.params.length&&"string"==typeof this.params[0].address&&this.params[0].show_display;this.confirmed=t,this.useUi=!t}get info(){return 1===this.params.length?`Export Stellar address for account #${_(this.params[0].address_n[2])+1}`:"Export multiple Stellar addresses"}getButtonRequestData(e){if("ButtonRequest_Address"===e)return{type:"address",serializedPath:R(this.params[this.progress].address_n),address:this.params[this.progress].address||"not-set"}}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:this.info}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async noBackupConfirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await e.promise).payload}async _call({address_n:e,show_display:t}){const r=this.device.getCommands();return(await r.typedCall("StellarGetAddress","StellarAddress",{address_n:e,show_display:t})).message}async run(){const e=[];for(let t=0;t{const i=r+1>=t.length,{type:n,...s}=t[r];if(i){return(await e(n,"StellarSignedTx",s)).message}return await e(n,"StellarTxOpRequest",s),gs(e,t,r+1)},ys=async(e,t,r,i)=>{const n=(e=>{if(!e.timebounds)throw g("Runtime","transformSignMessage: Unspecified timebounds are not supported");const t={address_n:[],network_passphrase:"",source_account:e.source,fee:e.fee,sequence_number:e.sequence,timebounds_start:e.timebounds.minTime,timebounds_end:e.timebounds.maxTime,memo_type:Je.StellarMemoType.NONE,num_operations:e.operations.length};return e.memo&&(t.memo_type=e.memo.type,t.memo_text=e.memo.text,t.memo_id=e.memo.id,t.memo_hash=e.memo.hash),t})(i);n.address_n=t,n.network_passphrase=r;const s=[];return i.operations.forEach((e=>{const t=(e=>{switch(e.type){case"createAccount":return It(e,[{name:"destination",type:"string",required:!0},{name:"startingBalance",type:"uint",required:!0}]),{type:"StellarCreateAccountOp",source_account:e.source,new_account:e.destination,starting_balance:e.startingBalance};case"payment":return It(e,[{name:"destination",type:"string",required:!0},{name:"amount",type:"uint",required:!0}]),{type:"StellarPaymentOp",source_account:e.source,destination_account:e.destination,asset:e.asset,amount:e.amount};case"pathPaymentStrictReceive":return It(e,[{name:"destAmount",type:"uint",required:!0}]),{type:"StellarPathPaymentStrictReceiveOp",source_account:e.source,send_asset:e.sendAsset,send_max:e.sendMax,destination_account:e.destination,destination_asset:e.destAsset,destination_amount:e.destAmount,paths:e.path};case"pathPaymentStrictSend":return It(e,[{name:"destMin",type:"uint",required:!0}]),{type:"StellarPathPaymentStrictSendOp",source_account:e.source,send_asset:e.sendAsset,send_amount:e.sendAmount,destination_account:e.destination,destination_asset:e.destAsset,destination_min:e.destMin,paths:e.path};case"createPassiveSellOffer":return It(e,[{name:"amount",type:"uint",required:!0}]),{type:"StellarCreatePassiveSellOfferOp",source_account:e.source,buying_asset:e.buying,selling_asset:e.selling,amount:e.amount,price_n:e.price.n,price_d:e.price.d};case"manageSellOffer":return It(e,[{name:"amount",type:"uint",required:!0}]),{type:"StellarManageSellOfferOp",source_account:e.source,buying_asset:e.buying,selling_asset:e.selling,amount:e.amount,offer_id:e.offerId||0,price_n:e.price.n,price_d:e.price.d};case"manageBuyOffer":return It(e,[{name:"amount",type:"uint",required:!0}]),{type:"StellarManageBuyOfferOp",source_account:e.source,buying_asset:e.buying,selling_asset:e.selling,amount:e.amount,offer_id:e.offerId||0,price_n:e.price.n,price_d:e.price.d};case"setOptions":{const t=e.signer?{signer_type:e.signer.type,signer_key:e.signer.key,signer_weight:e.signer.weight}:void 0;return{type:"StellarSetOptionsOp",source_account:e.source,clear_flags:e.clearFlags,set_flags:e.setFlags,master_weight:e.masterWeight,low_threshold:e.lowThreshold,medium_threshold:e.medThreshold,high_threshold:e.highThreshold,home_domain:e.homeDomain,inflation_destination_account:e.inflationDest,...t}}case"changeTrust":return It(e,[{name:"limit",type:"uint"}]),{type:"StellarChangeTrustOp",source_account:e.source,asset:e.line,limit:e.limit};case"allowTrust":return{type:"StellarAllowTrustOp",source_account:e.source,trusted_account:e.trustor,asset_type:e.assetType,asset_code:e.assetCode,is_authorized:!!e.authorize};case"accountMerge":return{type:"StellarAccountMergeOp",source_account:e.source,destination_account:e.destination};case"manageData":return{type:"StellarManageDataOp",source_account:e.source,key:e.name,value:e.value};case"bumpSequence":return{type:"StellarBumpSequenceOp",source_account:e.source,bump_to:e.bumpTo}}})(e);t&&s.push(t)})),await e("StellarSignTx","StellarTxOpRequest",n),gs(e,s,0)},vs=Object.freeze({manageBuyOffer:["1.10.4","2.4.3"],pathPaymentStrictSend:["1.10.4","2.4.3"]});class ws extends St{init(){this.requiredPermissions=["read","write"],this.firmwareRange=At(this.name,q("Stellar"),this.firmwareRange);const{payload:e}=this;It(e,[{name:"path",required:!0},{name:"networkPassphrase",type:"string",required:!0},{name:"transaction",required:!0}]);const t=x(e.path,3),{transaction:r}=e;this.params={path:t,networkPassphrase:e.networkPassphrase,transaction:r}}get info(){return"Sign Stellar transaction"}_isFeatureSupported(e){return this.device.atLeast(vs[e])}_ensureFeatureIsSupported(e){if(!this._isFeatureSupported(e))throw g("Method_InvalidParameter",`Feature ${e} not supported by device firmware`)}_ensureFirmwareSupportsParams(){const{params:e}=this;e.transaction.operations&&e.transaction.operations.find((e=>"manageBuyOffer"===e.type))&&this._ensureFeatureIsSupported("manageBuyOffer"),e.transaction.operations&&e.transaction.operations.find((e=>"pathPaymentStrictSend"===e.type))&&this._ensureFeatureIsSupported("pathPaymentStrictSend")}async run(){this._ensureFirmwareSupportsParams();const e=await ys(this.device.getCommands().typedCall.bind(this.device.getCommands()),this.params.path,this.params.networkPassphrase,this.params.transaction);return{publicKey:e.public_key,signature:e.signature}}}class _s extends St{progress=0;init(){this.requiredPermissions=["read"],this.firmwareRange=At(this.name,q("Tezos"),this.firmwareRange),this.hasBundle=!!this.payload.bundle;const e=this.payload.bundle?this.payload:{...this.payload,bundle:[this.payload]};It(e,[{name:"bundle",type:"array"},{name:"useEventListener",type:"boolean"}]),this.params=e.bundle.map((e=>{It(e,[{name:"path",required:!0},{name:"address",type:"string"},{name:"showOnTrezor",type:"boolean"}]);return{address_n:x(e.path,3),address:e.address,show_display:"boolean"!=typeof e.showOnTrezor||e.showOnTrezor}}));const t=e.useEventListener&&1===this.params.length&&"string"==typeof this.params[0].address&&this.params[0].show_display;this.confirmed=t,this.useUi=!t}get info(){return 1===this.params.length?`Export Tezos address for account #${_(this.params[0].address_n[2])+1}`:"Export multiple Tezos addresses"}getButtonRequestData(e){if("ButtonRequest_Address"===e)return{type:"address",serializedPath:R(this.params[this.progress].address_n),address:this.params[this.progress].address||"not-set"}}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:this.info}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}async noBackupConfirmation(){await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"no-backup"}));return(await e.promise).payload}async _call({address_n:e,show_display:t}){const r=this.device.getCommands();return(await r.typedCall("TezosGetAddress","TezosAddress",{address_n:e,show_display:t})).message}async run(){const e=[];for(let t=0;t{It(e,[{name:"path",required:!0},{name:"showOnTrezor",type:"boolean"}]);return{address_n:x(e.path,3),show_display:"boolean"!=typeof e.showOnTrezor||e.showOnTrezor}}))}get info(){return"Export Tezos public key"}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);let t;t=this.params.length>1?"Export multiple Tezos public keys":`Export Tezos public key for account #${_(this.params[0].address_n[2])+1}`,this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"export-address",label:t}));const r=await e.promise;return this.confirmed=r.payload,this.confirmed}async run(){const e=[],t=this.device.getCommands();for(let r=0;rEs.decode(t).slice(e.length),Is=(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r},Os=e=>{switch(e.substring(0,3)){case"tz1":return{originated:0,hash:Is(new Uint8Array([0]),Ts(Ss.tz1,e))};case"tz2":return{originated:0,hash:Is(new Uint8Array([1]),Ts(Ss.tz2,e))};case"tz3":return{originated:0,hash:Is(new Uint8Array([2]),Ts(Ss.tz3,e))};case"KT1":return{originated:1,hash:Is(Ts(Ss.KT1,e),new Uint8Array([0]))};default:throw g("Method_InvalidParameter","Wrong Tezos publicKeyHash address")}},As=e=>{switch(e.substring(0,4)){case"edpk":return Is(new Uint8Array([0]),Ts(Ss.edpk,e));case"sppk":return Is(new Uint8Array([1]),Ts(Ss.sppk,e));case"p2pk":return Is(new Uint8Array([2]),Ts(Ss.p2pk,e));default:throw g("Method_InvalidParameter","Wrong Tezos publicKey")}};class js extends St{init(){this.requiredPermissions=["read","write"],this.firmwareRange=At(this.name,q("Tezos"),this.firmwareRange);const{payload:e}=this;It(e,[{name:"path",required:!0},{name:"branch",type:"string",required:!0},{name:"operation",required:!0}]);const t=x(e.path,3);this.params=((e,t,r)=>{let i={address_n:e,branch:Ts(Ss.B,t)};if(r.reveal){const{reveal:e}=r;It(e,[{name:"source",type:"string",required:!0},{name:"public_key",type:"string",required:!0},{name:"fee",type:"uint",required:!0},{name:"counter",type:"number",required:!0},{name:"gas_limit",type:"number",required:!0},{name:"storage_limit",type:"number",required:!0}]),i={...i,reveal:{source:Os(e.source).hash,public_key:As(e.public_key),fee:e.fee,counter:e.counter,gas_limit:e.gas_limit,storage_limit:e.storage_limit}}}if(r.transaction){const{transaction:e}=r;if(It(e,[{name:"source",type:"string",required:!0},{name:"destination",type:"string",required:!0},{name:"amount",type:"uint",required:!0},{name:"counter",type:"number",required:!0},{name:"fee",type:"uint",required:!0},{name:"gas_limit",type:"number",required:!0},{name:"storage_limit",type:"number",required:!0}]),i={...i,transaction:{source:Os(e.source).hash,destination:{tag:Os(e.destination).originated,hash:Os(e.destination).hash},amount:e.amount,counter:e.counter,fee:e.fee,gas_limit:e.gas_limit,storage_limit:e.storage_limit}},Object.prototype.hasOwnProperty.call(e,"parameters")&&(i={...i,transaction:{...i.transaction,parameters:e.parameters}}),e.parameters_manager){const{parameters_manager:t}=e;if(It(t,[{name:"set_delegate",type:"string",required:!1},{name:"cancel_delegate",type:"boolean",required:!1},{name:"transfer",type:"object",required:!1}]),t.set_delegate&&(i={...i,transaction:{...i.transaction,parameters_manager:{set_delegate:Os(t.set_delegate).hash}}}),Object.prototype.hasOwnProperty.call(t,"cancel_delegate")&&(i={...i,transaction:{...i.transaction,parameters_manager:{cancel_delegate:!0}}}),t.transfer){const{transfer:e}=t;It(e,[{name:"amount",type:"uint",required:!0},{name:"destination",type:"string",required:!0}]),i={...i,transaction:{...i.transaction,parameters_manager:{transfer:{destination:{tag:Os(e.destination).originated,hash:Os(e.destination).hash},amount:e.amount}}}}}}}if(r.origination){const{origination:e}=r;It(e,[{name:"source",type:"string",required:!0},{name:"balance",type:"number",required:!0},{name:"fee",type:"uint",required:!0},{name:"counter",type:"number",required:!0},{name:"gas_limit",type:"number",required:!0},{name:"storage_limit",type:"number",required:!0},{name:"script",type:"string",required:!0}]),i={...i,origination:{source:Os(e.source).hash,balance:e.balance,fee:e.fee,counter:e.counter,gas_limit:e.gas_limit,storage_limit:e.storage_limit,script:e.script}},e.delegate&&(i={...i,origination:{...i.origination,delegate:Os(e.delegate).hash}})}if(r.delegation){const{delegation:e}=r;It(e,[{name:"source",type:"string",required:!0},{name:"delegate",type:"string",required:!0},{name:"fee",type:"uint",required:!0},{name:"counter",type:"number",required:!0},{name:"gas_limit",type:"number",required:!0},{name:"storage_limit",type:"number",required:!0}]),i={...i,delegation:{source:Os(e.source).hash,delegate:Os(e.delegate).hash,fee:e.fee,counter:e.counter,gas_limit:e.gas_limit,storage_limit:e.storage_limit}}}return i})(t,e.branch,e.operation)}get info(){return"Sign Tezos transaction"}async run(){const e=this.device.getCommands();return(await e.typedCall("TezosSignTx","TezosSignedTx",this.params)).message}}class ks extends St{init(){this.requiredPermissions=["read"],this.skipFinalReload=!0,this.firmwareRange=At(this.name,void 0,this.firmwareRange);const{payload:e}=this;It(e,[{name:"path",required:!0},{name:"mac",type:"string"}]);const t=x(e.path,1);this.params={address_n:t,mac:e.mac}}async run(){const e=this.device.getCommands(),{message:t}=await e.unlockPath(this.params);return{address_n:this.params.address_n,mac:t.mac}}}var xs=__webpack_require__("../../node_modules/buffer/index.js").Buffer;class Rs extends St{init(){this.requiredPermissions=["read","write"];const{payload:e}=this;It(e,[{name:"address",type:"string",required:!0},{name:"signature",type:"string",required:!0},{name:"message",type:"string",required:!0},{name:"coin",type:"string",required:!0},{name:"hex",type:"boolean"}]);const t=D(e.coin);if(!t)throw g("Method_UnknownCoin");this.firmwareRange=At(this.name,t,this.firmwareRange);const r=e.hex?fi(e.message):xs.from(e.message,"utf8").toString("hex"),i=xs.from(e.signature,"base64").toString("hex");this.params={address:e.address,signature:i,message:r,coin_name:t.name}}get info(){const e=D(this.payload.coin);return e?N("Verify #NETWORK message",e):"Verify message"}async run(){const e=this.device.getCommands();return(await e.typedCall("VerifyMessage","Success",this.params)).message}}class Ps extends St{init(){this.allowDeviceMode=[Xe.INITIALIZE,Xe.SEEDLESS,Xe.BOOTLOADER],this.useDeviceState=!1,this.requiredPermissions=["management"],this.firmwareRange=At(this.name,null,this.firmwareRange)}async confirmation(){if(this.confirmed)return!0;await this.getPopupPromise().promise;const e=this.createUiPromise(Xe.RECEIVE_CONFIRMATION);this.postMessage(Ye(Xe.REQUEST_CONFIRMATION,{view:"device-management",customConfirmButton:{className:"wipe",label:`Wipe ${this.device.toMessageObject().label}`},label:"Are you sure you want to wipe your device?"}));const t=await e.promise;return this.confirmed=t.payload,this.confirmed}get info(){return"Wipe device"}async run(){const e=this.device.getCommands();this.device.isBootloader()&&this.device.emit(ge,this.device,{code:"ButtonRequest_WipeDevice"});return(await e.typedCall("WipeDevice","Success")).message}}class Ns extends St{init(){this.useEmptyPassphrase=!0,this.requiredPermissions=["management"],this.useDeviceState=!1}async run(){const{device:e}=this,t=`${e.features.major_version}.${e.features.minor_version}.${e.features.patch_version}`;if(!ne(e.features.major_version).find((e=>e.version.join(".")===t)))throw g("Runtime","checkFirmwareAuthenticity: No release found for device firmware");const r=`${`https://data.trezor.io/firmware/${e.features.major_version}`}/trezor-${t}${e.firmwareType===rt.BitcoinOnly?"-bitcoinonly.bin":".bin"}`,i=await a(r,"binary");if(!i)throw g("Runtime","checkFirmwareAuthenticity: firmware binary not found");const{hash:n,challenge:s}=Cn(e.features.major_version,kn(i),(0,Ee.O6)(32)),o=await this.device.getCommands().typedCall("GetFirmwareHash","FirmwareHash",{challenge:s}),{message:u}=o,{hash:h}=u;return{expectedFirmwareHash:n,actualFirmwareHash:h,valid:h===n}}}const Cs=ze("InteractionTimeout");class Bs{timeout=null;seconds=0;constructor(e){e&&(this.seconds=e)}start(e,t){const r=t||this.seconds;r<1||(this.stop(),Cs.debug(`starting interaction timeout for ${r} seconds`),this.timeout=setTimeout((()=>{Cs.debug("interaction timed out"),e()}),1e3*r))}stop(){this.timeout&&(Cs.debug("clearing interaction timeout"),clearTimeout(this.timeout))}}var Us=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;let Ds,Ls,qs;const Fs=[],zs=[];let Hs,Vs,Gs,Ws;const Ks=ze("Core"),$s=e=>{if(e.event===ft){const t=zs.findIndex((t=>t&&t.responseID===e.id));t>=0&&zs.splice(t,1)}Ds.emit("CORE_EVENT",e)},Zs=(e=!0)=>(e&&$s(Ye(Xe.REQUEST_UI_WINDOW)),qs||(qs=(0,n.createDeferred)()),qs),Ys=()=>Vs.start((()=>{uo("Interaction timeout")})),Xs=(e,t)=>{const r={...(0,n.createDeferred)(e),device:t};return Fs.push(r),Ys(),r},Js=e=>Fs.find((t=>t.id===e)),Qs=e=>{Fs.splice(0).push(...Fs.filter((t=>t!==e)))},eo=async t=>{if(!t.id||!t.payload||t.type!==vt)throw g("Method_InvalidParameter","onCall: message.id or message.payload is missing");const r=t.id,n=he.getSettings("trustedHost"),s=he.getSettings("popup");let o,a,u;Hs&&!t.payload.device&&(t.payload.device=Hs);try{o=(t=>{const{method:r}=t.payload;if("string"!=typeof r)throw g("Method_InvalidParameter","Message method is not set");const i=e[r];if(i)return new i(t);throw g("Method_InvalidParameter",`Method ${r} not found`)})(t),o.postMessage=$s,o.getPopupPromise=Zs,o.createUiPromise=Xs,o.init(),zs.push(o),o.initAsync&&(o.initAsyncPromise=o.initAsync(),await o.initAsyncPromise)}catch(e){return $s(yt(gt)),$s(pt(r,!1,{error:e})),Us.resolve()}if(!o.useDevice){try{o.useUi?await Zs().promise:$s(yt(gt));const e=await o.run();a=pt(o.responseID,!0,e)}catch(e){a=pt(o.responseID,!1,{error:e})}return $s(a),Us.resolve()}if(Ls||he.getSettings("transportReconnect")||await po(he.getSettings()),o.isManagementRestricted())return $s(yt(gt)),$s(pt(r,!1,{error:g("Method_NotAllowed")})),Us.resolve();try{u=await(async e=>{if(!Ls)throw g("Transport_Missing");const t="WebUsbTransport"===Ls.transportType();let r,i=t;if(e.devicePath)r=Ls.getDevice(e.devicePath),i=!!r?.unreadableError;else{const e=Ls.asArray();1!==e.length||t?i=!0:(r=Ls.getDevice(e[0].path),i=!!r?.unreadableError)}if(i){if(Xs(Xe.RECEIVE_DEVICE),await Zs().promise,!Ls)throw g("Transport_Missing");const e=Ls.asArray();if(1!==e.length||"unreadable"===e[0].type||t){$s(Ye(Xe.SELECT_DEVICE,{webusb:t,devices:Ls.asArray()}));const e=Js(Xe.RECEIVE_DEVICE);if(e){const{payload:t}=await e.promise;t.remember&&(Hs=t.device),r=Ls.getDevice(t.device.path)}}else r=Ls.getDevice(e[0].path)}if(!r)throw g("Device_NotFound");return r})(o)}catch(e){throw"Transport_Missing"===e.code?(await Zs().promise,$s(Ye(Xe.TRANSPORT))):$s(yt(gt)),$s(pt(r,!1,{error:e})),e}o.postMessage=e=>((e,t,r)=>{if(t.type===Ze.REQUEST_CONFIRMATION){const{device:i}=r;e({...t,payload:{...t.payload,analytics:{type:"device/selected",payload:{mode:i?.mode||"",pinProtection:i?.features?.pin_protection||"",passphraseProtection:i?.features?.passphrase_protection||"",backupType:i?.features?.backup_type||"Bip39",language:i?.features?.language||"",model:i?.features?.internal_model||"",vendor:i?.features?.vendor||"",firmwareRevision:i?.features?.revision||"",firmwareType:i?.firmwareType||"",bootloaderHash:i?.features?.bootloader_hash||""}}}})}else e(t)})($s,e,{device:u.toMessageObject()}),o.setDevice(u);const h=zs.filter((e=>e&&e!==o&&e.devicePath===o.devicePath));if(h.length>0&&o.overridePreviousCall){h.forEach((e=>{e.overridden=!0}));const e=g("Method_Override");if(Ws=u.override(e),await Ws,o.overridden)throw $s(pt(o.responseID,!1,{error:e})),e}else if(u.isRunning()){if(u.isLoaded())throw $s(pt(r,!1,{error:g("Device_CallInProgress")})),g("Device_CallInProgress");await u.waitForFirstRun()}u.setInstance(t.payload.device?.instance),o.hasExpectedDeviceState&&u.setExternalState(o.deviceState),u.on(ge,((e,t)=>{io(e,t,o)})),u.on(ye,no),u.on(_e,so),u.on(ve,o.useEmptyPassphrase?ao:oo),u.on(we,(()=>{$s(Ye(Xe.REQUEST_PASSPHRASE_ON_DEVICE,{device:u.toMessageObject()}))}));try{let e=1;const t=3,r=async()=>{const i=await o.checkFirmwareRange(s);if(i)return s?(await Zs().promise,$s(Ye(i,u.toMessageObject())),await Xs(fe,u).promise,Us.reject(g("Method_Cancel"))):Us.reject(g("Device_FwException",i));const h=u.hasUnexpectedMode(o.allowDeviceMode,o.requireDeviceMode);if(h)return u.keepSession=!1,s?(await Zs().promise,$s(Ye(h,u.toMessageObject())),await Xs(fe,u).promise,Us.reject(g("Device_ModeException",h))):Us.reject(g("Device_ModeException",h));if(o.checkPermissions(),!n&&o.requiredPermissions.length>0){if(!await o.requestPermissions())return Us.reject(g("Method_PermissionsNotGranted"))}const l=u.features.needs_backup;if(l&&"function"==typeof o.noBackupConfirmation){if(!await o.noBackupConfirmation(!s))return Us.reject(g("Method_PermissionsNotGranted"))}if(l&&(await Zs().promise,$s(Ye(Xe.DEVICE_NEEDS_BACKUP,u.toMessageObject()))),"outdated"===u.firmwareStatus&&(await Zs().promise,$s(Ye(Xe.FIRMWARE_OUTDATED,u.toMessageObject()))),!n&&"function"==typeof o.confirmation){if(!await o.confirmation())return Us.reject(g("Method_Cancel"))}const d=u.features.unlocked;try{const e=o.useDeviceState?await u.validateState(o.network,o.preauthorized):void 0;if(e){if(!s)throw g("Device_InvalidState");{const t=Xs(Xe.INVALID_PASSPHRASE_ACTION,u);$s(Ye(Xe.INVALID_PASSPHRASE,{device:u.toMessageObject()}));if((await t.promise).payload)return u.setInternalState(void 0),await u.initialize(o.useEmptyPassphrase,o.useCardanoDerivation),r();u.setExternalState(e)}}}catch(i){return"PIN invalid"===i.message&&eUs.resolve()),{skipFinalReload:!0})),await u.cleanup(),ro(),to(),o&&o.dispose(),Ls&&e.success&&Ls.removeAuthPenalty(u),$s(e))}},to=()=>{qs=void 0,Fs.splice(0),Vs.stop(),Ks.debug("Cleanup...")},ro=()=>{qs&&$s(yt(gt)),$s(Ye(Xe.CLOSE_UI_WINDOW))},io=async(...[e,t,r])=>{const i="ButtonRequest_Address"===t.code;(!i||i&&r.useUi)&&await Zs().promise;const n="function"==typeof r.getButtonRequestData&&t.code?r.getButtonRequestData(t.code):void 0;Ys(),$s(Me(ge,{...t,device:e.toMessageObject()})),$s(Ye(Xe.REQUEST_BUTTON,{...t,device:e.toMessageObject(),data:n})),i&&!r.useUi&&$s(Ye(Xe.ADDRESS_VALIDATION,n))},no=async(...[e,t,r])=>{await Zs().promise;const i=Xs(Xe.RECEIVE_PIN,e);$s(Ye(Xe.REQUEST_PIN,{device:e.toMessageObject(),type:t}));r(null,(await i.promise).payload)},so=async(...[e,t,r])=>{await Zs().promise;const i=Xs(Xe.RECEIVE_WORD,e);$s(Ye(Xe.REQUEST_WORD,{device:e.toMessageObject(),type:t}));r(null,(await i.promise).payload)},oo=async(...[e,t])=>{await Zs().promise;const r=Xs(Xe.RECEIVE_PASSPHRASE,e);$s(Ye(Xe.REQUEST_PASSPHRASE,{device:e.toMessageObject()}));const i=await r.promise,{value:n,passphraseOnDevice:s,save:o}=i.payload;t({passphrase:n.normalize("NFKD"),passphraseOnDevice:s,cache:o})},ao=(...[e,t])=>{t({passphrase:""})},uo=e=>{const t=e?g("Method_Cancel",e):g("Method_Interrupted");Ls&&Ls.asArray().length>0?(Ls.allDevices().forEach((e=>{if(e.keepSession=!1,e.isUsedHere())Ws=e.interruptionFromUser(t);else{const e=Js(fe);e?e.resolve({type:fe,payload:void 0}):(zs.forEach((e=>{$s(pt(e.responseID,!1,{error:t}))})),zs.splice(0,zs.length))}})),to()):(Fs.length>0&&(Fs.forEach((e=>{e.reject(t)})),Fs.splice(0)),qs&&(qs.reject(t),qs=void 0),to())},ho=e=>{const t=Js(Xe.RECEIVE_DEVICE);if(t&&Ls){const e=Ls.asArray(),r="WebUsbTransport"===Ls.transportType();1!==e.length||r?$s(Ye(Xe.SELECT_DEVICE,{webusb:r,devices:e})):(t.resolve({type:Xe.RECEIVE_DEVICE,payload:{device:e[0]}}),Qs(t))}if(e){const{path:t}=e;let r=!1;Fs.forEach((e=>{e.device&&e.device.getDevicePath()===t&&(e.id===fe&&e.resolve({type:fe}),r=!0)})),Hs&&Hs.path===t&&(Hs=void 0),r&&(ro(),to())}},lo=async e=>{try{Ls=new ct,Ls.on(de,(e=>{ho(),$s(Me(de,e))})),Ls.on(ce,(e=>{ho(),$s(Me(ce,e))})),Ls.on(fe,(e=>{ho(e),$s(Me(fe,e))})),Ls.on(pe,(e=>{$s(Me(pe,e))})),Ls.on(i.TRANSPORT.ERROR,(t=>{if(Ks.warn("TRANSPORT.ERROR",t),Ls&&(Ls.disconnectDevices(),Ls.dispose()),Ls=void 0,$s(wt(i.TRANSPORT.ERROR,{error:t})),e.transportReconnect){const{promise:t,timeout:r}=ut(1e3,null);Gs=r,t.then((()=>{lo(e)}))}})),Ls.on(i.TRANSPORT.START,(e=>$s(wt(i.TRANSPORT.START,e)))),Ls.init(),Ls&&await Ls.waitForTransportFirstEvent()}catch(t){if(Ls=void 0,$s(wt(i.TRANSPORT.ERROR,{error:t})),!e.transportReconnect)throw t;{const{promise:t,timeout:r}=ut(3e3,null);Gs=r,await t,await lo(e)}}};class co extends(r()){handleMessage(e){(e=>{switch(Ks.debug("handleMessage",e),e.type){case mt:Zs(!1).resolve();break;case bt:uo(e.payload?e.payload.error:null);break;case i.TRANSPORT.DISABLE_WEBUSB:mo();break;case i.TRANSPORT.REQUEST_DEVICE:Ls?.enumerate();break;case Xe.RECEIVE_DEVICE:case Xe.RECEIVE_CONFIRMATION:case Xe.RECEIVE_PERMISSION:case Xe.RECEIVE_PIN:case Xe.RECEIVE_PASSPHRASE:case Xe.INVALID_PASSPHRASE_ACTION:case Xe.RECEIVE_ACCOUNT:case Xe.RECEIVE_FEE:case Xe.RECEIVE_WORD:case Xe.LOGIN_CHALLENGE_RESPONSE:{const t=Js(e.type);t&&(t.resolve(e),Qs(t));break}case vt:eo(e).catch((e=>{Ks.error("onCall",e)}))}})(e)}async dispose(){Jt.dispose(),Gs&&clearTimeout(Gs),this.removeAllListeners(),Ls&&await Ls.dispose()}getCurrentMethod(){return zs}getTransportInfo(){if(Ls)return Ls.getTransportInfo()}}const fo=async(e,t)=>{t&&(e=>{Object.keys(qe).forEach((t=>{Fe=e(),qe[t].setWriter(Fe)}))})(t);try{return await he.load(e),r=he.getSettings("debug"),Object.keys(qe).forEach((e=>{qe[e].enabled=!!r})),Ds=new co,Vs=new Bs(e.popup?e.interactionTimeout:0),Ds}catch(e){throw Ks.error("init",e),e}var r},po=async e=>{try{e.transportReconnect?lo(e):await lo(e)}catch(e){throw Ks.error("initTransport",e),e}},mo=async()=>{if(!Ls)return;if("WebUsbTransport"!==Ls.transportType())return;const e=he.getSettings();if(e.transports){const t=e.transports?.filter((e=>"object"!=typeof e));t.includes("WebUsbTransport")&&e.transports.splice(e.transports.indexOf("WebUsbTransport"),1),t.includes("BridgeTransport")||e.transports.unshift("BridgeTransport")}try{await Ls.dispose(),await lo(e)}catch(e){}},bo={directory:"",packages:[{name:"RPM package",platform:["rpm32","rpm64"],url:"/udev/trezor-udev-2-1.noarch.rpm"},{name:"DEB package",platform:["deb32","deb64"],url:"/udev/trezor-udev_2_all.deb"}]},go=e=>{const t=bo;return t.packages.find((e=>e.preferred))||e&&(t.packages=t.packages.map((t=>({...t,preferred:t.platform.indexOf(e)>=0})))),t},yo="9.1.4",vo=`https://connect.trezor.io/${yo.split(".").map((e=>parseInt(e,10)))[0]}/`,wo=((new Date).getTime(),e=>{const t=Et(e);return ae.whitelist.find((r=>r.origin===e||r.origin===t))}),_o=(e={},r)=>{const i=(0,t.parseConnectSettings)(e);i.origin=r&&"null"!==r?r:"unknown";const n="localhost"===window?.location?.hostname,s=wo(i.origin);i.trustedHost=(n||!!s)&&!i.popup,i.trustedHost||(i.popup=!0),i.trustedHost||s||n||(i.debug=!1),i.priority=(e=>e?e.priority:2)(s);let o=!1;"file:"===window?.location?.protocol&&(i.origin=`file://${window.location.pathname}`,i.webusb=!1,o=!0),i.popup&&"webextension"!==i.env&&(o=!0,i.webusb=!1),o&&(i.transports=i.transports?.filter((e=>"WebUsbTransport"!==e)));const a=(e=>ae.knownHosts.find((t=>t.origin===e)))(i.extension||i.origin||"");return a&&(i.hostLabel=a.label,i.hostIcon=a.icon),i};var Mo=__webpack_require__("../connect-analytics/lib/index.js");const Eo=new function(){return new SharedWorker(__webpack_require__.p+"./workers/shared-logger-worker.js")};Eo.port.start();const So=()=>({add:e=>Eo.port.postMessage({type:"add-log",data:e})});var To=__webpack_require__("../../node_modules/es6-promise/dist/es6-promise.js").Promise;let Io;const Oo=ze("IFrame"),Ao=ze("@trezor/connect-web",!1);let jo;const ko=e=>{if(e.source===window||!e.data)return;const{data:r}=e,i="number"==typeof r.id?r.id:0,n=e=>{xo((0,t.createResponseMessage)(i,!1,{error:e})),xo((0,t.createPopupMessage)(t.POPUP.CANCEL_POPUP_REQUEST))};if(r.type===t.IFRAME.LOG&&"@trezor/connect-web"===r.payload.prefix){const{level:e,prefix:t,message:i}=r.payload;return void(Array.isArray(i)?Ao.addMessage(e,t,...i):Ao.addMessage(e,i))}if(!Io&&r.type===t.IFRAME.CALL)return void n("Core not initialized yet!");if(r.type===t.IFRAME.INIT)return void No(r.payload,e.origin);if(r.type===t.POPUP.HANDSHAKE&&e.origin===window.location.origin){if(e.target!==jo){if(e.ports?.length<1)return void n("POPUP.HANDSHAKE: popupMessagePort not found");[jo]=e.ports}if(!Io)return void n("POPUP.HANDSHAKE: Core not initialized");const r=Io.getCurrentMethod()[0];(r.initAsyncPromise?r.initAsyncPromise:To.resolve()).finally((()=>{const e=Io.getTransportInfo(),i=he.getSettings();xo((0,t.createPopupMessage)(t.POPUP.HANDSHAKE,{settings:he.getSettings(),transport:e,method:r?r.info:void 0}));const{tracking_enabled:n,tracking_id:s}=_t.storage.load();Mo.analytics.init(n||!1,{instanceId:s,commitId:"109db0a3f6fc6fc5cdb24098ee50480692c92dbf",isDev:!1,useQueue:!0});const{method:o,...a}=r.payload;Mo.analytics.report({type:Mo.EventType.AppReady,payload:{version:i?.version,origin:i?.origin,referrerApp:i?.manifest?.appUrl,referrerEmail:i?.manifest?.email,method:o,payload:r.payload?Object.keys(a):void 0,transportType:e?.type,transportVersion:e?.version}})}))}r.type===t.POPUP.CLOSED&&jo instanceof MessagePort&&(jo=void 0),r.type===t.POPUP.ANALYTICS_RESPONSE&&(r.payload.enabled?Mo.analytics.enable():Mo.analytics.disable());const s=wo(e.origin),o=e.origin===window.location.origin||!!s,a=Mt(e.origin);if(!o&&a!==he.getSettings("origin")&&a!==Mt(document.referrer))return;const u=(0,t.parseMessage)(r);e.preventDefault(),e.stopImmediatePropagation();const h=[t.IFRAME.CALL,t.POPUP.CLOSED,t.UI.LOGIN_CHALLENGE_RESPONSE,t.TRANSPORT.DISABLE_WEBUSB];(o||-1!==h.indexOf(u.type))&&Io&&Io.handleMessage(u)},xo=e=>{Oo.debug("postMessage",e);const r=he.getSettings("popup"),i=he.getSettings("trustedHost"),n=e.type===t.IFRAME.LOADED;if(!r){if(Io&&e.type===t.UI.REQUEST_UI_WINDOW)return void Io.handleMessage({event:t.UI_EVENT,type:t.POPUP.HANDSHAKE});if(e.type===t.POPUP.CANCEL_POPUP_REQUEST)return}if((i||n||e.event!==t.TRANSPORT_EVENT)&&(i||e.event!==t.DEVICE_EVENT||Po(e))){if(e.event===t.TRANSPORT_EVENT){const t=(0,_t.getInstallerPackage)();e.payload.bridge=(e=>{const t=oe();return t.packages.find((e=>e.preferred))||e&&(t.packages=t.packages.map((t=>({...t,preferred:t.platform.indexOf(e)>=0})))),t})(t),e.payload.udev=go(t)}if(r&&jo&&jo.postMessage(e),!r||Ro(e)){let t=he.getSettings("origin");(!t||t.indexOf("file://")>=0)&&(t="*"),window.parent.postMessage(e,t)}}},Ro=e=>[t.IFRAME.LOADED,t.IFRAME.ERROR,t.POPUP.CANCEL_POPUP_REQUEST,t.UI.CLOSE_UI_WINDOW,t.UI.LOGIN_CHALLENGE_REQUEST,t.UI.BUNDLE_PROGRESS,t.UI.ADDRESS_VALIDATION,t.RESPONSE_EVENT,t.DEVICE.CONNECT,t.DEVICE.CONNECT_UNACQUIRED,t.DEVICE.CHANGED,t.DEVICE.DISCONNECT,t.DEVICE.BUTTON].includes(e.type),Po=e=>{if(!e.payload)return!1;const t="device"in e.payload?e.payload.device.features:e.payload.features;if(t){const e=_t.storage.load().permissions||_t.storage.load(!0).permissions;if(e){return e.filter((e=>e.origin===he.getSettings("origin")&&"read"===e.type&&e.device===t.device_id)).length>0}}return!1},No=async(e,r)=>{if(he.getSettings("origin"))return;const i=_o({...e.settings,extension:e.extension},r);if(i.popup&&"undefined"!=typeof BroadcastChannel){const e=`${i.env}-${i.timestamp}`;try{jo=new BroadcastChannel(e),jo.onmessage=e=>ko(e)}catch(e){}}Oo.enabled=!!i.debug;try{Io=await fo(i,So),Io.on(t.CORE_EVENT,xo),await po(i),xo((0,t.createIFrameMessage)(t.IFRAME.LOADED,{useBroadcastChannel:!!jo,systemInfo:(0,_t.getSystemInfo)(ae.supportedBrowsers)}))}catch(e){xo((0,t.createIFrameMessage)(t.IFRAME.ERROR,{error:e}))}};window.addEventListener("message",ko,!1),window.addEventListener("unload",(()=>{Io&&Io.dispose()}))})()})(); \ No newline at end of file diff --git a/app/trezor-prebuild/build/workers/blockbook-worker.0e43b55c4eaca985c610.js b/app/trezor-prebuild/build/workers/blockbook-worker.0e43b55c4eaca985c610.js new file mode 100644 index 0000000000..6d06d35d54 --- /dev/null +++ b/app/trezor-prebuild/build/workers/blockbook-worker.0e43b55c4eaca985c610.js @@ -0,0 +1,17 @@ +(()=>{var e={"../blockchain-link-types/lib/constants/errors.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomError=void 0;const r="blockchain_link/",n={worker_not_found:"Worker not found",worker_invalid:"Invalid worker object",worker_timeout:"Worker timeout",worker_unknown_request:"Unknown message type:",worker_runtime:void 0,invalid_param:"Invalid parameter:",websocket_not_initialized:"WebSocket not initialized",websocket_no_url:"Cannot connect because no server was specified",websocket_timeout:"Websocket timeout",websocket_error_message:void 0,websocket_runtime_error:void 0};class i extends Error{constructor(e,t=""){if(super(t),this.message="",this.message=t,"string"==typeof e){const i=0===e.indexOf(r)?e.substring(16,e.length):e;this.code=`${r}${i}`;const s=n[i];"string"==typeof s&&(""===this.message?this.message=s:0===t.indexOf("+")&&(this.message=`${s} ${t.substring(1)}`))}"string"==typeof this.message&&""!==this.message||(this.message="Message not set")}}t.CustomError=i},"../blockchain-link-types/lib/constants/index.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NETWORKS=t.RESPONSES=t.MESSAGES=void 0;const o=s(r("../blockchain-link-types/lib/constants/messages.js"));t.MESSAGES=o;const c=s(r("../blockchain-link-types/lib/constants/responses.js"));t.RESPONSES=c,t.NETWORKS={RIPPLE:"ripple",BLOCKBOOK:"blockbook",BLOCKFROST:"blockfrost"}},"../blockchain-link-types/lib/constants/messages.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TERMINATE=t.PUSH_TRANSACTION=t.UNSUBSCRIBE=t.SUBSCRIBE=t.ESTIMATE_FEE=t.GET_TRANSACTION=t.GET_ACCOUNT_UTXO=t.GET_ACCOUNT_INFO=t.GET_BLOCK=t.GET_BLOCK_HASH=t.GET_FIAT_RATES_TICKERS_LIST=t.GET_ACCOUNT_BALANCE_HISTORY=t.GET_FIAT_RATES_FOR_TIMESTAMPS=t.GET_CURRENT_FIAT_RATES=t.GET_INFO=t.DISCONNECT=t.CONNECT=t.INIT=t.HANDSHAKE=void 0,t.HANDSHAKE="m_handshake",t.INIT="m_init",t.CONNECT="m_connect",t.DISCONNECT="m_disconnect",t.GET_INFO="m_get_info",t.GET_CURRENT_FIAT_RATES="m_get_current_fiat_rates",t.GET_FIAT_RATES_FOR_TIMESTAMPS="m_get_fiat_rates_for_timestamps",t.GET_ACCOUNT_BALANCE_HISTORY="m_get_account_balance_history",t.GET_FIAT_RATES_TICKERS_LIST="m_get_fiat_rates_tickers_list",t.GET_BLOCK_HASH="m_get_block_hash",t.GET_BLOCK="m_get_block",t.GET_ACCOUNT_INFO="m_get_account_info",t.GET_ACCOUNT_UTXO="m_get_account_utxo",t.GET_TRANSACTION="m_get_transaction",t.ESTIMATE_FEE="m_estimate_fee",t.SUBSCRIBE="m_subscribe",t.UNSUBSCRIBE="m_unsubscribe",t.PUSH_TRANSACTION="m_push_tx",t.TERMINATE="terminate"},"../blockchain-link-types/lib/constants/responses.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NOTIFICATION=t.DISCONNECTED=t.CONNECTED=t.PUSH_TRANSACTION=t.UNSUBSCRIBE=t.SUBSCRIBE=t.ESTIMATE_FEE=t.GET_TRANSACTION=t.GET_ACCOUNT_BALANCE_HISTORY=t.GET_ACCOUNT_UTXO=t.GET_ACCOUNT_INFO=t.GET_FIAT_RATES_TICKERS_LIST=t.GET_FIAT_RATES_FOR_TIMESTAMPS=t.GET_CURRENT_FIAT_RATES=t.GET_BLOCK=t.GET_BLOCK_HASH=t.GET_INFO=t.CONNECT=t.ERROR=void 0,t.ERROR="r_error",t.CONNECT="r_connect",t.GET_INFO="r_info",t.GET_BLOCK_HASH="r_get_block_hash",t.GET_BLOCK="r_get_block",t.GET_CURRENT_FIAT_RATES="r_get_current_fiat_rates",t.GET_FIAT_RATES_FOR_TIMESTAMPS="r_get_fiat_rates_for_timestamps",t.GET_FIAT_RATES_TICKERS_LIST="r_GET_FIAT_RATES_TICKERS_LIST",t.GET_ACCOUNT_INFO="r_account_info",t.GET_ACCOUNT_UTXO="r_get_account_utxo",t.GET_ACCOUNT_BALANCE_HISTORY="r_get_account_balance_history",t.GET_TRANSACTION="r_get_transaction",t.ESTIMATE_FEE="r_estimate_fee",t.SUBSCRIBE="r_subscribe",t.UNSUBSCRIBE="r_unsubscribe",t.PUSH_TRANSACTION="r_push_tx",t.CONNECTED="r_connected",t.DISCONNECTED="r_disconnected",t.NOTIFICATION="r_notification"},"../blockchain-link-utils/lib/blockbook.js":function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.transformAccountUtxo=t.transformAccountInfo=t.transformAddresses=t.transformTokenInfo=t.transformTransaction=t.isTxFailed=t.filterEthereumInternalTransfers=t.filterTokenTransfers=t.transformServerInfo=void 0;const i=n(r("../../node_modules/bignumber.js/bignumber.js")),s=r("../blockchain-link-utils/lib/utils.js");t.transformServerInfo=e=>{var t;return{name:e.name,shortcut:e.shortcut,testnet:e.testnet,version:e.version,decimals:e.decimals,blockHeight:e.bestHeight,blockHash:e.bestHash,consensusBranchId:(null===(t=e.backend)||void 0===t?void 0:t.consensus)?parseInt(e.backend.consensus.chaintip,16):void 0}};t.filterTokenTransfers=(e,t)=>{if("string"==typeof e&&(e=[e]),!(e&&Array.isArray(e)&&t&&Array.isArray(t)))return[];const r=e.map((e=>"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.address?e.address:null));return t.filter((e=>!(!e||"object"!=typeof e)&&(e.from&&r.indexOf(e.from)>=0||e.to&&r.indexOf(e.to)>=0))).map((e=>{const t=e.from&&r.indexOf(e.from)>=0,n=e.to&&r.indexOf(e.to)>=0;let i;i=t&&n?"self":t?"sent":"recv";const s=Object.assign(Object.assign({},e),{type:i,decimals:e.decimals||0,amount:e.value||"",standard:e.type});return delete s.value,s}))};t.filterEthereumInternalTransfers=(e,t)=>{const r=null==t?void 0:t.internalTransfers;return e&&(null==r?void 0:r.length)?r.filter((({type:t,from:r,to:n})=>0===t&&[r,n].includes(e))).map((({from:t,to:r,value:n})=>{const i=t===e;let s;return s=i&&r===e?"self":i?"sent":"recv",{type:s,amount:n,from:t,to:r}})):[]};t.isTxFailed=e=>{var t;return!(!e.blockHeight||e.blockHeight<0)&&0===(null===(t=e.ethereumSpecific)||void 0===t?void 0:t.status)};t.transformTransaction=(e,r,n)=>{var o,c;const u=r?r.change.concat(r.used,r.unused).map((e=>e.address)):[e],a=Array.isArray(n.vin)?n.vin:[],l=a.reduce(s.sumVinVout,0),f=(0,s.filterTargets)(u,n.vin),h=f.reduce(s.sumVinVout,0),d=Array.isArray(n.vout)?n.vout:[],p=d.reduce(s.sumVinVout,0),g=(0,s.filterTargets)(u,n.vout),b=g.reduce(s.sumVinVout,0),y=(0,t.filterTokenTransfers)(u,n.tokenTransfers),m=(0,t.filterEthereumInternalTransfers)(e,n.ethereumSpecific),v=e=>!r||(0,s.filterTargets)(r.change,n.vout).indexOf(e)<0,_=e=>e.value&&"0"!==e.value;let w,E,T;if(null===(o=n.ethereumSpecific)||void 0===o?void 0:o.createdContract)w="contract",E=n.value,T=[];else if(f.length)if(f.length"sent"===e.type)),r=e.find((e=>"recv"!==e.type));t?w="sent":!g.length&&r&&(w="self")}else w="unknown",E=n.value,T=[];w=(0,t.isTxFailed)(n)?"failed":w;const A=!(!n.rbf&&!a.find((e=>"number"==typeof e.sequence&&e.sequence<4294967294)))||void 0,S=n.ethereumSpecific&&!n.ethereumSpecific.gasUsed?new i.default(n.ethereumSpecific.gasPrice).times(n.ethereumSpecific.gasLimit).toString():n.fees,O=n.vsize?new i.default(S).div(n.vsize).decimalPlaces(2).toString():void 0,j=n.size||("string"==typeof n.hex?n.hex.length/2:0);return{type:w,txid:n.txid,hex:n.hex,blockTime:n.blockTime,blockHeight:n.blockHeight,blockHash:n.blockHash,lockTime:n.lockTime,amount:E,fee:S,vsize:n.vsize,feeRate:O,targets:T.filter((e=>"object"==typeof e)).map((e=>(0,s.transformTarget)(e,g))),tokens:y,internalTransfers:m,rbf:A,ethereumSpecific:n.ethereumSpecific,details:{vin:a.map((0,s.enhanceVinVout)(u)),vout:d.map((0,s.enhanceVinVout)(u)),size:j,totalInput:l.toString(),totalOutput:p.toString()}}};t.transformTokenInfo=e=>{if(!e||!Array.isArray(e))return;const t=e.reduce(((e,t)=>"XPUBAddress"===t.type?e:e.concat([Object.assign(Object.assign({},t),{decimals:t.decimals||0})])),[]);return t.length>0?t:void 0};t.transformAddresses=e=>{if(!e||!Array.isArray(e))return;const t=e.reduce(((e,t)=>"XPUBAddress"!==t.type?e:e.concat([{address:t.name,path:t.path,transfers:t.transfers,balance:t.balance,sent:t.totalSent,received:t.totalReceived}])),[]);if(t.length<1)return;const r=t.filter((e=>"1"===e.path.split("/")[4])),n=t.filter((e=>r.indexOf(e)<0));return{change:r,used:n.filter((e=>e.transfers>0)),unused:n.filter((e=>0===e.transfers))}};t.transformAccountInfo=e=>{let r;"number"==typeof e.page&&(r={index:e.page,size:e.itemsOnPage,total:e.totalPages});let n={};if("string"==typeof e.nonce&&(n.nonce=e.nonce),e.erc20Contract){const r=(0,t.transformTokenInfo)([Object.assign(Object.assign({},e.erc20Contract),{type:e.erc20Contract.type||"ERC20"})]);if(r){const[e]=r;n.erc20Contract=e}}Object.keys(n).length<1&&(n=void 0);const s=e.address,o=(0,t.transformAddresses)(e.tokens),c=(0,t.transformTokenInfo)(e.tokens),u=new i.default(e.unconfirmedBalance),a=u.isNaN()||u.isZero()?e.balance:u.plus(e.balance).toString(),l=0===e.txs&&0===e.unconfirmedTxs&&new i.default(a).isZero();return{descriptor:s,balance:e.balance,availableBalance:a,empty:l,tokens:c,addresses:o,history:{addrTxCount:e.addrTxCount,total:e.txs,tokens:"number"==typeof e.nonTokenTxs?e.txs-e.nonTokenTxs:void 0,unconfirmed:e.unconfirmedTxs,transactions:e.transactions?e.transactions.map((e=>(0,t.transformTransaction)(s,o,e))):void 0},misc:n,page:r}};t.transformAccountUtxo=e=>e.map((e=>({txid:e.txid,vout:e.vout,amount:e.value,blockHeight:e.height,address:e.address,path:e.path,confirmations:e.confirmations,coinbase:e.coinbase})))},"../blockchain-link-utils/lib/utils.js":function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sortTxsFromLatest=t.transformTarget=t.sumVinVout=t.enhanceVinVout=t.filterTargets=t.isAccountOwned=void 0;const i=n(r("../../node_modules/bignumber.js/bignumber.js")),s=r("../utils/lib/index.js");t.isAccountOwned=e=>t=>Array.isArray(null==t?void 0:t.addresses)&&t.addresses.some((t=>e.includes(t)));t.filterTargets=(e,r)=>{if("string"==typeof e&&(e=[e]),!(e&&Array.isArray(e)&&r&&Array.isArray(r)))return[];const n=e.map((e=>"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.address?e.address:void 0)).filter(s.isNotUndefined);return r.filter((0,t.isAccountOwned)(n))};t.enhanceVinVout=e=>r=>Object.assign(Object.assign({},r),{isAccountOwned:(0,t.isAccountOwned)(e)(r)||void 0});t.sumVinVout=(e,{value:t})=>"string"==typeof t?new i.default(t||"0").plus(e):e;t.transformTarget=(e,t)=>({n:e.n||0,addresses:e.addresses,isAddress:e.isAddress,amount:e.value,coinbase:e.coinbase,isAccountTarget:!!t.includes(e)||void 0});const o=({blockHeight:e})=>void 0===e||e<=0?Number.MAX_SAFE_INTEGER:e;t.sortTxsFromLatest=e=>{const t=e.slice().sort(((e,t)=>o(t)-o(e)));let r=0;for(;re.details.vin.some((({txid:e})=>e===t.txid))));t.splice(r,i.length,...i)}r=n}return t}},"../blockchain-link/lib/utils/socks-proxy-agent.js":e=>{"use strict";e.exports=e=>({})},"../blockchain-link/lib/utils/ws.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r("../../node_modules/events/events.js");class i extends n.EventEmitter{constructor(e,t,r){super(),this._ws=new WebSocket(e),this._ws.onclose=()=>{this.emit("close")},this._ws.onopen=()=>{this.emit("open")},this._ws.onerror=e=>{this.emit("error",new Error(`WsWrapper error. Ready state: ${this.readyState}`))},this._ws.onmessage=e=>{this.emit("message",e.data)}}close(){1===this.readyState&&this._ws.close()}send(e){this._ws.send(e)}get readyState(){return this._ws.readyState}}i.CONNECTING=0,i.OPEN=1,i.CLOSING=2,i.CLOSED=3,t.default=i},"../blockchain-link/lib/workers/baseWebsocket.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseWebsocket=void 0;const s=i(r("../blockchain-link/lib/utils/ws.js")),o=r("../utils/lib/createDeferred.js"),c=r("../utils/lib/typedEventEmitter.js"),u=r("../blockchain-link-types/lib/constants/errors.js");class a extends c.TypedEmitter{constructor(e){super(),this.messages=[],this.subscriptions=[],this.emitter=this,this.messageID=0,this.options=e}setConnectionTimeout(e){this.clearConnectionTimeout(),this.connectionTimeout=setTimeout(this.onTimeout.bind(this),e||this.options.timeout||2e4)}clearConnectionTimeout(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=void 0)}setPingTimeout(){this.pingTimeout&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(this.onPing.bind(this),this.options.pingTimeout||5e4)}rejectAllPending(e,t){this.messages.forEach((r=>r.reject(new u.CustomError(e,t)))),this.messages.splice(0,this.messages.length)}onTimeout(){const{ws:e}=this;if(e)if(e.listenerCount("open")>0){e.emit("error",new u.CustomError("websocket_timeout"));try{e.close()}catch(e){}}else this.rejectAllPending("websocket_timeout"),e.close()}async onPing(){if(this.ws&&this.isConnected())try{this.subscriptions.length>0||this.options.keepAlive?await this.ping():this.ws.close()}catch(e){}}onError(){this.onClose()}sendMessage(e){var t,r;const{ws:n}=this;if(!n)throw new u.CustomError("websocket_not_initialized");const i=this.messageID.toString(),s=(0,o.createDeferred)(i),c=Object.assign({id:i},e);return this.messageID++,this.messages.push(s),this.setConnectionTimeout(),this.setPingTimeout(),null===(r=(t=this.options).onSending)||void 0===r||r.call(t,e),n.send(JSON.stringify(c)),s.promise}onMessage(e){try{const t=JSON.parse(e),{id:r,data:n}=t,i=this.messages.find((e=>e.id===r));if(i)n.error?i.reject(new u.CustomError("websocket_error_message",n.error.message)):i.resolve(n),this.messages.splice(this.messages.indexOf(i),1);else{const e=this.subscriptions.find((e=>e.id===r));e&&e.callback(n)}}catch(e){}0===this.messages.length&&this.clearConnectionTimeout(),this.setPingTimeout()}addSubscription(e,t){const r=this.messageID.toString();this.subscriptions.push({id:r,type:e,callback:t})}removeSubscription(e){const t=this.subscriptions.findIndex((t=>t.type===e));return t>=0&&this.subscriptions.splice(t,1),t}async connect(){var e;if(this.connectPromise)return this.connectPromise;(null===(e=this.ws)||void 0===e?void 0:e.readyState)===s.default.CLOSING&&await new n((e=>this.emitter.once("disconnected",e))),this.setConnectionTimeout(this.options.connectionTimeout);const t=(0,o.createDeferred)(-1);this.connectPromise=t.promise;const r=this.createWebsocket();return r.once("error",(e=>{this.onClose(),t.reject(new u.CustomError("websocket_runtime_error",e.message))})),r.on("open",(()=>{this.init(),t.resolve()})),this.ws=r,t.promise.finally((()=>{this.connectPromise=void 0}))}init(){const{ws:e}=this;if(!e||!this.isConnected())throw Error("Websocket init cannot be called");this.clearConnectionTimeout(),e.removeAllListeners(),e.on("error",this.onError.bind(this)),e.on("message",this.onMessage.bind(this)),e.on("close",(()=>{this.onClose(),this.emitter.emit("disconnected")}))}disconnect(){var e;null===(e=this.ws)||void 0===e||e.close()}isConnected(){var e;return(null===(e=this.ws)||void 0===e?void 0:e.readyState)===s.default.OPEN}onClose(){var e;this.pingTimeout&&clearTimeout(this.pingTimeout),this.connectionTimeout&&clearTimeout(this.connectionTimeout),this.isConnected()&&this.disconnect(),null===(e=this.ws)||void 0===e||e.removeAllListeners(),this.rejectAllPending("websocket_runtime_error","Websocket closed unexpectedly")}dispose(){this.onClose(),this.removeAllListeners()}}t.BaseWebsocket=a},"../blockchain-link/lib/workers/baseWorker.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseWorker=t.CONTEXT=void 0;const s=i(r("../blockchain-link/lib/utils/socks-proxy-agent.js")),o=r("../blockchain-link-types/lib/constants/errors.js"),c=r("../blockchain-link/lib/workers/state.js"),u=r("../blockchain-link/lib/workers/utils.js"),a=r("../blockchain-link-types/lib/constants/index.js");t.CONTEXT="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope||"undefined"!=typeof importScripts?"worker":"main";t.BaseWorker=class{constructor(){this.settings={},"worker"===t.CONTEXT?this.post=e=>self.postMessage(e):this.post=e=>this.onmessage({data:e}),this.state=new c.WorkerState,setTimeout((()=>{this.post({id:-1,type:a.MESSAGES.HANDSHAKE})}),10)}debug(...e){if(!this.settings.debug)return;const t=`[Worker "${this.settings.name}"]:`,r=e[0];"warn"===r||"error"===r?console[r](t,...e.slice(1)):console.log(t,...e)}cleanup(){this.api=void 0,this.state.cleanup()}connect(){if(this.isConnected(this.api))return n.resolve(this.api);if(!this.connectPromise){const e=Array.isArray(this.settings.server)?this.settings.server.filter((e=>"string"==typeof e)):[];if(e.length<1)throw new o.CustomError("connect","Endpoint not set");const t=(0,u.prioritizeEndpoints)(e);this.connectPromise=this.connectRecursive(t).then((e=>(this.debug("Connected"),this.api=e,this.connectPromise=void 0,e)))}return this.connectPromise}connectRecursive([e,...t]){if(!e)throw new o.CustomError("connect","All backends are down");return this.proxyAgent&&(this.proxyAgent.protocol=/^(https|wss):/.test(e)?"https:":"http:"),this.debug("Connecting to",e),this.tryConnect(e).catch((e=>(this.debug("Connection failed",e),this.connectRecursive(t))))}disconnect(){}async messageHandler(e){if(!e.data)return!0;const{data:t}=e,{id:r}=t;return this.debug("onmessage",t),t.type===a.MESSAGES.HANDSHAKE?(this.settings=t.settings,this.proxyAgent=t.settings.proxy?(0,s.default)(t.settings.proxy):void 0,!0):t.type===a.MESSAGES.CONNECT?(await this.connect(),this.post({id:r,type:a.RESPONSES.CONNECT,payload:!0}),!0):t.type===a.MESSAGES.DISCONNECT?(this.disconnect(),this.post({id:r,type:a.RESPONSES.DISCONNECTED,payload:!0}),!0):t.type===a.MESSAGES.TERMINATE?(this.disconnect(),this.cleanup(),!0):void 0}errorResponse(e,t){const r={code:"",message:""};t instanceof Error&&(r.message=t.message,r.code=t instanceof o.CustomError&&t.code?t.code:""),this.post({id:e,type:a.RESPONSES.ERROR,payload:r})}postMessage(e){this.messageHandler({data:e})}onmessage(e){}onmessageerror(e){}onerror(e){}terminate(){this.postMessage({id:-1,type:a.MESSAGES.TERMINATE})}}},"../blockchain-link/lib/workers/blockbook/websocket.js":function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BlockbookAPI=void 0;const i=n(r("../blockchain-link/lib/utils/ws.js")),s=r("../blockchain-link-types/lib/constants/errors.js"),o=r("../blockchain-link/lib/workers/baseWebsocket.js");class c extends o.BaseWebsocket{constructor(){super(...arguments),this.send=(e,t={})=>this.sendMessage({method:e,params:t})}createWebsocket(){let{url:e}=this.options;if("string"!=typeof e)throw new s.CustomError("websocket_no_url");if(e.startsWith("http")&&(e=e.replace("http","ws")),!e.endsWith("/websocket")){const t=e.endsWith("/")?"websocket":"/websocket";e+=t}return new i.default(e,{agent:this.options.agent,headers:Object.assign({Origin:"https://node.trezor.io","User-Agent":"Trezor Suite"},this.options.headers)})}ping(){return this.getBlockHash(1)}getServerInfo(){return this.send("getInfo")}getBlockHash(e){return this.send("getBlockHash",{height:e})}getBlock(e){return this.send("getBlock",{id:`${e}`})}getBlockFilter(e,t){return this.send("getBlockFilter",Object.assign({blockHash:e,scriptType:"taproot-noordinals"},t))}getBlockFiltersBatch(e,t,r){return this.send("getBlockFiltersBatch",Object.assign({bestKnownBlockHash:e,pageSize:t,scriptType:"taproot-noordinals"},r))}getMempoolFilters(e,t){return this.send("getMempoolFilters",Object.assign({fromTimestamp:e,scriptType:"taproot-noordinals"},t))}getAccountInfo(e){return this.send("getAccountInfo",e)}getAccountUtxo(e){return this.send("getAccountUtxo",{descriptor:e})}getTransaction(e){return this.send("getTransaction",{txid:e})}pushTransaction(e){return this.send("sendTransaction",{hex:e})}estimateFee(e){return this.send("estimateFee",e)}getCurrentFiatRates(e){return this.send("getCurrentFiatRates",e)}getAccountBalanceHistory(e){return this.send("getBalanceHistory",e)}getFiatRatesForTimestamps(e){return this.send("getFiatRatesForTimestamps",e)}getFiatRatesTickersList(e){return this.send("getFiatRatesTickersList",e)}subscribeAddresses(e){return this.removeSubscription("notification"),this.addSubscription("notification",(e=>this.emit("notification",e))),this.send("subscribeAddresses",{addresses:e})}unsubscribeAddresses(){return this.removeSubscription("notification")>=0?this.send("unsubscribeAddresses"):{subscribed:!1}}subscribeBlock(){return this.removeSubscription("block"),this.addSubscription("block",(e=>this.emit("block",e))),this.send("subscribeNewBlock")}unsubscribeBlock(){return this.removeSubscription("block")>=0?this.send("unsubscribeNewBlock"):{subscribed:!1}}subscribeFiatRates(e){return this.removeSubscription("fiatRates"),this.addSubscription("fiatRates",(e=>this.emit("fiatRates",e))),this.send("subscribeFiatRates",{currency:e})}unsubscribeFiatRates(){return this.removeSubscription("fiatRates")>=0?this.send("unsubscribeFiatRates"):{subscribed:!1}}subscribeMempool(){return this.removeSubscription("mempool"),this.addSubscription("mempool",(e=>this.emit("mempool",e))),this.send("subscribeNewTransaction")}unsubscribeMempool(){return this.removeSubscription("mempool")>=0?this.send("unsubscribeNewTransaction"):{subscribed:!1}}}t.BlockbookAPI=c},"../blockchain-link/lib/workers/state.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerState=void 0;const n=r("../blockchain-link-types/lib/constants/errors.js");t.WorkerState=class{constructor(){this.addresses=[],this.accounts=[],this.subscription={}}validateAddresses(e){if(!Array.isArray(e))throw new n.CustomError("invalid_param","+addresses");const t=[];return e.filter((e=>"string"==typeof e&&(!(t.indexOf(e)>=0)&&(t.push(e),!0))))}addAddresses(e){const t=this.validateAddresses(e).filter((e=>this.addresses.indexOf(e)<0));return this.addresses=this.addresses.concat(t),t}getAddresses(){return this.addresses}removeAddresses(e){const t=this.validateAddresses(e);return this.addresses=this.addresses.filter((e=>t.indexOf(e)<0)),this.addresses}validateAccounts(e){if(!Array.isArray(e))throw new n.CustomError("invalid_param","+accounts");const t=[];return e.filter((e=>!(!e||"object"!=typeof e||"string"!=typeof e.descriptor)&&(!(t.indexOf(e.descriptor)>=0)&&(t.push(e.descriptor),!0))))}getAccountAddresses(e){if(e.addresses){const{change:t,used:r,unused:n}=e.addresses;return t.concat(r,n).map((e=>e.address))}return[e.descriptor]}addAccounts(e){const t=this.validateAccounts(e),r=this.accounts.filter((e=>!t.find((t=>t.descriptor===e.descriptor))));this.accounts=r.concat(t);const n=this.accounts.reduce(((e,t)=>e.concat(this.getAccountAddresses(t))),[]);return this.addAddresses(n),t}getAccount(e){return this.accounts.find((t=>{if(t.descriptor===e)return!0;if(t.addresses){const{change:r,used:n,unused:i}=t.addresses;if(r.find((t=>t.address===e)))return!0;if(n.find((t=>t.address===e)))return!0;if(i.find((t=>t.address===e)))return!0}return!1}))}getAccounts(){return this.accounts}removeAccounts(e){const t=this.validateAccounts(e),r=this.accounts.filter((e=>t.find((t=>t.descriptor===e.descriptor)))),n=r.reduce(((e,t)=>e.concat(this.getAccountAddresses(t))),[]);return this.accounts=this.accounts.filter((e=>r.indexOf(e)<0)),this.removeAddresses(n),this.accounts}addSubscription(e){this.subscription[e]=!0}getSubscription(e){return this.subscription[e]}hasSubscriptions(){return Object.keys(this.subscription).length>0}removeSubscription(e){delete this.subscription[e]}clearSubscriptions(){Object.keys(this.subscription).forEach((e=>{delete this.subscription[e]}))}removeEmpty(e){return Object.keys(e).forEach((t=>{Array.isArray(e[t])&&e[t].map((e=>this.removeEmpty(e))),e[t]&&"object"==typeof e[t]?this.removeEmpty(e[t]):void 0===e[t]&&delete e[t]})),e}cleanup(){this.removeAccounts(this.getAccounts()),this.removeAddresses(this.getAddresses()),this.clearSubscriptions()}}},"../blockchain-link/lib/workers/utils.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prioritizeEndpoints=void 0;const n=r("../utils/lib/index.js");t.prioritizeEndpoints=e=>e.map((e=>{const t=(0,n.parseHostname)(e);let r=Math.random();return"localhost"===t||"127.0.0.1"===t?r+=2:(null==t?void 0:t.endsWith(".onion"))&&(r+=1),[e,r]})).sort((([,e],[,t])=>t-e)).map((([e])=>e))},"../utils/lib/arrayDistinct.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayDistinct=void 0;t.arrayDistinct=(e,t,r)=>r.indexOf(e)===t},"../utils/lib/arrayPartition.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayPartition=void 0;t.arrayPartition=(e,t)=>e.reduce((([e,r],n)=>t(n)?[[...e,n],r]:[e,[...r,n]]),[[],[]])},"../utils/lib/arrayShuffle.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayShuffle=void 0;t.arrayShuffle=e=>{const t=e.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1));[t[e],t[r]]=[t[r],t[e]]}return t}},"../utils/lib/arrayToDictionary.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayToDictionary=void 0;const r=e=>!!["string","number"].includes(typeof e);t.arrayToDictionary=(e,t,n)=>n?e.reduce(((e,n)=>{var i;const s=t(n);return r(s)?Object.assign(Object.assign({},e),{[s]:[...null!==(i=e[s])&&void 0!==i?i:[],n]}):e}),{}):e.reduce(((e,n)=>{const i=t(n);return r(i)?Object.assign(Object.assign({},e),{[i]:n}):e}),{})},"../utils/lib/bufferUtils.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").lW;Object.defineProperty(t,"__esModule",{value:!0}),t.getChunkSize=t.reverseBuffer=void 0;t.reverseBuffer=e=>{if(e.length<1)return e;const t=Buffer.alloc(e.length);let r=t.length-1;for(let n=0;n{const t=Buffer.allocUnsafe(1);return t.writeUInt8(e),t}},"../utils/lib/bytesToHumanReadable.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bytesToHumanReadable=void 0;const r=["B","KB","MB","GB","TB"];t.bytesToHumanReadable=e=>{let t=Math.abs(e),n=0;for(;t>=1024||n>=r.length;)t/=1024,n++;return`${t.toFixed(1)} ${r[n]}`}},"../utils/lib/capitalizeFirstLetter.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.capitalizeFirstLetter=void 0;t.capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1)},"../utils/lib/cloneObject.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneObject=void 0;t.cloneObject=e=>{const t=JSON.stringify(e);return void 0===t?e:JSON.parse(t)}},"../utils/lib/countBytesInString.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.countBytesInString=void 0;t.countBytesInString=e=>encodeURI(e).split(/%..|./).length-1},"../utils/lib/createCooldown.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCooldown=void 0;t.createCooldown=e=>{let t=0;return()=>{const r=Date.now();return r-t>=e&&(t=r,!0)}}},"../utils/lib/createDeferred.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferred=void 0;t.createDeferred=e=>{let t=()=>{},r=()=>{};const i=new n(((e,n)=>{t=e,r=n}));return{id:e,resolve:t,reject:r,promise:i}}},"../utils/lib/createTimeoutPromise.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.createTimeoutPromise=void 0;t.createTimeoutPromise=e=>new n((t=>setTimeout(t,e)))},"../utils/lib/enumUtils.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getValueByKey=t.getKeyByValue=void 0,t.getKeyByValue=function(e,t){return e&&Object.keys(e).find((r=>e[r]===t))},t.getValueByKey=function(e,t){const r=e&&Object.keys(e).find((e=>e===t));return r&&e[r]}},"../utils/lib/getLocaleSeparators.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLocaleSeparators=void 0;t.getLocaleSeparators=e=>{var t,r;const n=new Intl.NumberFormat(e).formatToParts(10000.1);return{decimalSeparator:null===(t=n.find((({type:e})=>"decimal"===e)))||void 0===t?void 0:t.value,thousandsSeparator:null===(r=n.find((({type:e})=>"group"===e)))||void 0===r?void 0:r.value}}},"../utils/lib/getNumberFromPixelString.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNumberFromPixelString=void 0;t.getNumberFromPixelString=e=>parseInt(e.replace("px",""),10)},"../utils/lib/getRandomNumberInRange.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRandomNumberInRange=void 0;t.getRandomNumberInRange=(e,t)=>Math.floor(Math.random()*(t-e+1))+e},"../utils/lib/getSynchronize.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.getSynchronize=void 0;t.getSynchronize=()=>{let e;return t=>{const r=(null!=e?e:n.resolve()).catch((()=>{})).then(t).finally((()=>{e===r&&(e=void 0)}));return e=r,e}}},"../utils/lib/getWeakRandomId.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWeakRandomId=void 0;t.getWeakRandomId=e=>{let t="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasUppercaseLetter=void 0;const r=new RegExp("^(.*[A-Z].*)$");t.hasUppercaseLetter=e=>r.test(e)},"../utils/lib/index.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.xssFilters=t.versionUtils=t.enumUtils=t.bufferUtils=void 0,s(r("../utils/lib/arrayDistinct.js"),t),s(r("../utils/lib/arrayPartition.js"),t),s(r("../utils/lib/arrayShuffle.js"),t),s(r("../utils/lib/arrayToDictionary.js"),t),t.bufferUtils=o(r("../utils/lib/bufferUtils.js")),s(r("../utils/lib/bytesToHumanReadable.js"),t),s(r("../utils/lib/capitalizeFirstLetter.js"),t),s(r("../utils/lib/cloneObject.js"),t),s(r("../utils/lib/countBytesInString.js"),t),s(r("../utils/lib/createCooldown.js"),t),s(r("../utils/lib/createDeferred.js"),t),s(r("../utils/lib/createTimeoutPromise.js"),t),t.enumUtils=o(r("../utils/lib/enumUtils.js")),s(r("../utils/lib/getNumberFromPixelString.js"),t),s(r("../utils/lib/getRandomNumberInRange.js"),t),s(r("../utils/lib/getSynchronize.js"),t),s(r("../utils/lib/getWeakRandomId.js"),t),s(r("../utils/lib/hasUppercaseLetter.js"),t),s(r("../utils/lib/isAscii.js"),t),s(r("../utils/lib/isHex.js"),t),s(r("../utils/lib/isNotUndefined.js"),t),s(r("../utils/lib/isUrl.js"),t),s(r("../utils/lib/mergeDeepObject.js"),t),s(r("../utils/lib/objectPartition.js"),t),s(r("../utils/lib/parseElectrumUrl.js"),t),s(r("../utils/lib/parseHostname.js"),t),s(r("../utils/lib/promiseAllSequence.js"),t),s(r("../utils/lib/redactUserPath.js"),t),s(r("../utils/lib/scheduleAction.js"),t),s(r("../utils/lib/throwError.js"),t),s(r("../utils/lib/truncateMiddle.js"),t),s(r("../utils/lib/topologicalSort.js"),t),s(r("../utils/lib/urlToOnion.js"),t),t.versionUtils=o(r("../utils/lib/versionUtils.js")),t.xssFilters=o(r("../utils/lib/xssFilters.js")),s(r("../utils/lib/getLocaleSeparators.js"),t)},"../utils/lib/isAscii.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAscii=void 0,t.isAscii=function(e){return!e||/^[\x00-\x7F]*$/.test(e)}},"../utils/lib/isHex.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHex=void 0;t.isHex=e=>/^(0x|0X)?[0-9A-Fa-f]+$/g.test(e)},"../utils/lib/isNotUndefined.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNotUndefined=void 0;t.isNotUndefined=e=>void 0!==e},"../utils/lib/isUrl.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUrl=void 0;const r=/^(http|ws)s?:\/\/[a-z0-9]([a-z0-9.-]+)?(:[0-9]{1,5})?((\/)?(([a-z0-9-_])+(\/)?)+)$/i;t.isUrl=e=>r.test(e)},"../utils/lib/mergeDeepObject.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeDeepObject=void 0;const r=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1};t.mergeDeepObject=(...e)=>e.reduce(((e,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach((i=>{["__proto__","constructor","prototype"].includes(i)||(Array.isArray(e[i])&&Array.isArray(n[i])?e[i]=t.mergeDeepObject.options.mergeArrays?Array.from(new Set(e[i].concat(n[i]))):n[i]:r(e[i])&&r(n[i])?e[i]=(0,t.mergeDeepObject)(e[i],n[i]):e[i]=n[i])})),e}),{});const n={mergeArrays:!0};t.mergeDeepObject.options=n,t.mergeDeepObject.withOptions=(e,...r)=>{t.mergeDeepObject.options=Object.assign({mergeArrays:!0},e);const i=(0,t.mergeDeepObject)(...r);return t.mergeDeepObject.options=n,i}},"../utils/lib/objectPartition.js":function(e,t){"use strict";var r=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);it.reduce((([e,t],n)=>{const i=t,s=n,o=i[s],c=r(i,["symbol"==typeof s?s:s+""]);return void 0!==o?[Object.assign(Object.assign({},e),{[n]:o}),c]:[e,t]}),[{},e])},"../utils/lib/parseElectrumUrl.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseElectrumUrl=void 0;const r=/^(?:([a-zA-Z0-9.-]+)|\[([a-f0-9:]+)\]):([0-9]{1,5}):([ts])$/;t.parseElectrumUrl=e=>{var t;const n=e.match(r);if(n)return{host:null!==(t=n[1])&&void 0!==t?t:n[2],port:Number.parseInt(n[3],10),protocol:n[4]}}},"../utils/lib/parseHostname.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseHostname=void 0;const r=/^([a-z0-9.+-]+:\/\/)?([a-z0-9.-]+)([:/][^:/]+)*\/?$/i;t.parseHostname=e=>{var t,n;return null===(n=null===(t=e.match(r))||void 0===t?void 0:t[2])||void 0===n?void 0:n.toLowerCase()}},"../utils/lib/promiseAllSequence.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function c(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.promiseAllSequence=void 0;t.promiseAllSequence=e=>i(void 0,void 0,void 0,(function*(){const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redactUserPathFromString=t.startOfUserPathRegex=void 0,t.startOfUserPathRegex=/([/\\][Uu]sers[/\\]{1,4})([^"^'^[^\]^/^\\]*)/g;t.redactUserPathFromString=e=>e.replace(t.startOfUserPathRegex,"$1[*]")},"../utils/lib/scheduleAction.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function c(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAction=void 0;const s=e=>Array.isArray(e),o=()=>new Error("Aborted by signal"),c=()=>new Error("Aborted by deadline"),u=()=>new Error("Aborted by timeout"),a=(e,t)=>new n(((r,n)=>{if(t.aborted)return n();if(void 0===e)return r();const i=setTimeout(r,e),s=()=>{clearTimeout(i),t.removeEventListener("abort",s),n()};t.addEventListener("abort",s)})),l=(e,t,r)=>new n(((n,i)=>{if(r.aborted)return i();const s=void 0!==e?setTimeout((()=>i(t())),e):void 0,o=()=>{clearTimeout(s),r.removeEventListener("abort",o),i()};r.addEventListener("abort",o)})),f=(e,t)=>new n(((r,n)=>{if(t.aborted)return n();if(null==e?void 0:e.aborted)return n(o());const i=()=>n(o());null==e||e.addEventListener("abort",i);const s=()=>{null==e||e.removeEventListener("abort",i),t.removeEventListener("abort",s),n()};t.addEventListener("abort",s)})),h=(e,t)=>i(void 0,void 0,void 0,(function*(){const r=new AbortController,i=()=>r.abort();t.aborted&&i(),t.addEventListener("abort",i);try{return yield new n((t=>t(e(r.signal))))}finally{t.removeEventListener("abort",i)}}));t.scheduleAction=(e,t)=>i(void 0,void 0,void 0,(function*(){const{signal:r,delay:o,attempts:d,timeout:p,deadline:g,gap:b}=t,y=g&&g-Date.now(),m=s(d)?d.length:null!=d?d:g?1/0:1,v=new AbortController,_=v.signal,w=s(d)?e=>d[e]:()=>({timeout:p,gap:b});try{return yield n.race([f(r,_),l(y,c,_),a(o,_).then((()=>((e,t,r,s)=>i(void 0,void 0,void 0,(function*(){for(let n=0;ne.abort();s.addEventListener("abort",i);try{return yield t(n,e.signal)}catch(e){i(),yield r(n)}finally{s.removeEventListener("abort",i)}}return s.aborted?n.reject():t(e-1,s)})))(m,((t,r)=>n.race([l(w(t).timeout,u,_),h(e,r)])),(e=>{var t;return a(null!==(t=w(e).gap)&&void 0!==t?t:0,_)}),_)))])}finally{v.abort()}}))},"../utils/lib/throwError.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;t.throwError=e=>{throw new Error(e)}},"../utils/lib/topologicalSort.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.topologicalSort=void 0;const n=r("../utils/lib/arrayPartition.js");t.topologicalSort=(e,t,r)=>{const i=[],s=e=>(0,n.arrayPartition)(e,(r=>!e.some((e=>t(e,r)))));let o=e;for(;o.length;){const[e,t]=s(o);if(!e.length)throw new Error("Cycle detected");i.push(...r?e.sort(r):e),o=t}return i}},"../utils/lib/truncateMiddle.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.truncateMiddle=void 0;t.truncateMiddle=(e,t,r)=>{if(e.length<=t+r)return e;return`${e.substring(0,t)}…${e.substring(e.length-r,e.length)}`}},"../utils/lib/typedEventEmitter.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedEmitter=void 0;const n=r("../../node_modules/events/events.js");class i extends n.EventEmitter{listenerCount(e){return super.listenerCount(e)}}t.TypedEmitter=i},"../utils/lib/urlToOnion.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.urlToOnion=void 0;t.urlToOnion=(e,t)=>{var r;const[,n,i,s,o]=null!==(r=e.match(/^(http|ws)s?:\/\/([^:/]+\.)?([^/.]+\.[^/.]+)(\/.*)?$/i))&&void 0!==r?r:[];if(s&&t[s])return`${n}://${null!=i?i:""}${t[s]}${null!=o?o:""}`}},"../utils/lib/versionUtils.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeVersion=t.isNewerOrEqual=t.isEqual=t.isNewer=t.isVersionArray=void 0;t.isVersionArray=e=>{if(!Array.isArray(e))return!1;if(3!==e.length)return!1;for(let t=0;t({major:e[0],minor:e[1],patch:e[2]}),n=e=>{const r=e.split(".").map((e=>Number(e)));if(!(0,t.isVersionArray)(r))throw new Error("version string is in wrong format");return r},i=e=>`${e[0]}.${e[1]}.${e[2]}`;t.isNewer=(e,t)=>{const i=r("string"==typeof e?n(e):e),s=r("string"==typeof t?n(t):t);return i.major-s.major!=0?i.major>s.major:i.minor-s.minor!=0?i.minor>s.minor:i.patch-s.patch!=0&&i.patch>s.patch};t.isEqual=(e,t)=>("string"==typeof e?e:i(e))===("string"==typeof t?t:i(t));t.isNewerOrEqual=(e,r)=>(0,t.isNewer)(e,r)||(0,t.isEqual)(e,r);t.normalizeVersion=e=>e.replace(/\b0+(\d)/g,"$1")},"../utils/lib/xssFilters.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inDoubleQuotes=t.inSingleQuotes=t.inHTML=void 0;const r=/e.replace(r,"<");t.inSingleQuotes=e=>e.replace(n,"'");t.inDoubleQuotes=e=>e.replace(i,""")},"../../node_modules/base64-js/index.js":(e,t)=>{"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,s=c(e),o=s[0],u=s[1],a=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,u)),l=0,f=u>0?o-4:o;for(r=0;r>16&255,a[l++]=t>>8&255,a[l++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,a[l++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,a[l++]=t>>8&255,a[l++]=255&t);return a},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=16383,c=0,a=n-i;ca?a:c+o));1===i?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,s,o=[],c=t;c>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},"../../node_modules/bignumber.js/bignumber.js":function(e,t,r){var n;!function(i){"use strict";var s,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,c=Math.ceil,u=Math.floor,a="[BigNumber Error] ",l=a+"Number primitive has more than 15 significant digits: ",f=1e14,h=14,d=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,b=1e9;function y(e){var t=0|e;return e>0||e===t?t:t-1}function m(e){for(var t,r,n=1,i=e.length,s=e[0]+"";na^r?1:-1;for(c=(u=i.length)<(a=s.length)?u:a,o=0;os[o]^r?1:-1;return u==a?0:u>a^r?1:-1}function _(e,t,r,n){if(er||e!==u(e))throw Error(a+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return y(e.e/h)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function T(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else tx?y.c=y.e=null:e.e=10;f/=10,a++);return void(a>x?y.c=y.e=null:(y.e=a,y.c=[e]))}b=String(e)}else{if(!o.test(b=String(e)))return i(y,b,p);y.s=45==b.charCodeAt(0)?(b=b.slice(1),-1):1}(a=b.indexOf("."))>-1&&(b=b.replace(".","")),(f=b.search(/e/i))>0?(a<0&&(a=f),a+=+b.slice(f+1),b=b.substring(0,f)):a<0&&(a=b.length)}else{if(_(t,2,H.length,"Base"),10==t&&$)return q(y=new z(e),R+y.e+1,B);if(b=String(e),p="number"==typeof e){if(0*e!=0)return i(y,b,p,t);if(y.s=1/e<0?(b=b.slice(1),-1):1,z.DEBUG&&b.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else y.s=45===b.charCodeAt(0)?(b=b.slice(1),-1):1;for(r=H.slice(0,t),a=f=0,g=b.length;fa){a=g;continue}}else if(!c&&(b==b.toUpperCase()&&(b=b.toLowerCase())||b==b.toLowerCase()&&(b=b.toUpperCase()))){c=!0,f=-1,a=0;continue}return i(y,String(e),p,t)}p=!1,(a=(b=n(b,t,10,y.s)).indexOf("."))>-1?b=b.replace(".",""):a=b.length}for(f=0;48===b.charCodeAt(f);f++);for(g=b.length;48===b.charCodeAt(--g););if(b=b.slice(f,++g)){if(g-=f,p&&z.DEBUG&&g>15&&(e>d||e!==u(e)))throw Error(l+y.s*e);if((a=a-f-1)>x)y.c=y.e=null;else if(a=U)?E(u,o):T(u,o,"0");else if(s=(e=q(new z(e),t,r)).e,c=(u=m(e.c)).length,1==n||2==n&&(t<=s||s<=P)){for(;cc){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=s-c)>0)for(s+1==c&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function V(e,t){for(var r,n=1,i=new z(e[0]);n=10;i/=10,n++);return(r=n+r*h-1)>x?e.c=e.e=null:r=10;a/=10,i++);if((s=t-i)<0)s+=h,o=t,g=(l=b[d=0])/y[i-o-1]%10|0;else if((d=c((s+1)/h))>=b.length){if(!n)break e;for(;b.length<=d;b.push(0));l=g=0,i=1,o=(s%=h)-h+1}else{for(l=a=b[d],i=1;a>=10;a/=10,i++);g=(o=(s%=h)-h+i)<0?0:l/y[i-o-1]%10|0}if(n=n||t<0||null!=b[d+1]||(o<0?l:l%y[i-o-1]),n=r<4?(g||n)&&(0==r||r==(e.s<0?3:2)):g>5||5==g&&(4==r||n||6==r&&(s>0?o>0?l/y[i-o]:0:b[d-1])%10&1||r==(e.s<0?8:7)),t<1||!b[0])return b.length=0,n?(t-=e.e+1,b[0]=y[(h-t%h)%h],e.e=-t||0):b[0]=e.e=0,e;if(0==s?(b.length=d,a=1,d--):(b.length=d+1,a=y[h-s],b[d]=o>0?u(l/y[i-o]%y[o])*a:0),n)for(;;){if(0==d){for(s=1,o=b[0];o>=10;o/=10,s++);for(o=b[0]+=a,a=1;o>=10;o/=10,a++);s!=a&&(e.e++,b[0]==f&&(b[0]=1));break}if(b[d]+=a,b[d]!=f)break;b[d--]=0,a=1}for(s=b.length;0===b[--s];b.pop());}e.e>x?e.c=e.e=null:e.e=U?E(t,r):T(t,r,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(a+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(r=e[t],0,b,t),R=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(r=e[t],0,8,t),B=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(_(r[0],-b,0,t),_(r[1],0,b,t),P=r[0],U=r[1]):(_(r,-b,b,t),P=-(U=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)_(r[0],-b,-1,t),_(r[1],1,b,t),M=r[0],x=r[1];else{if(_(r,-b,b,t),!r)throw Error(a+t+" cannot be zero: "+r);M=-(x=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(a+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw L=!r,Error(a+"crypto unavailable");L=r}else L=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(_(r=e[t],0,b,t),G=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(a+t+" not an object: "+r);D=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(a+t+" invalid: "+r);$="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:R,ROUNDING_MODE:B,EXPONENTIAL_AT:[P,U],RANGE:[M,x],CRYPTO:L,MODULO_MODE:F,POW_PRECISION:G,FORMAT:D,ALPHABET:H}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,r,n=e.c,i=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===s||-1===s)&&i>=-b&&i<=b&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%h)<1&&(t+=h),String(n[0]).length==t){for(t=0;t=f||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===s||1===s||-1===s))return!0;throw Error(a+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return V(arguments,I.lt)},z.minimum=z.min=function(){return V(arguments,I.gt)},z.random=(s=9007199254740992,A=Math.random()*s&2097151?function(){return u(Math.random()*s)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,s,o=0,l=[],f=new z(C);if(null==e?e=R:_(e,0,b),i=c(e/h),L)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));o>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(l.push(s%1e14),o+=2);o=i/2}else{if(!crypto.randomBytes)throw L=!1,Error(a+"crypto unavailable");for(t=crypto.randomBytes(i*=7);o=9e15?crypto.randomBytes(7).copy(t,o):(l.push(s%1e14),o+=7);o=i/7}if(!L)for(;o=10;s/=10,o++);or-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(n,i,s,o,c){var u,a,l,f,h,d,p,g,b=n.indexOf("."),y=R,v=B;for(b>=0&&(f=G,G=0,n=n.replace(".",""),d=(g=new z(i)).pow(n.length-b),G=f,g.c=t(T(m(d.c),d.e,"0"),10,s,e),g.e=g.c.length),l=f=(p=t(n,i,s,c?(u=H,e):(u=e,H))).length;0==p[--f];p.pop());if(!p[0])return u.charAt(0);if(b<0?--l:(d.c=p,d.e=l,d.s=o,p=(d=r(d,g,y,v,s)).c,h=d.r,l=d.e),b=p[a=l+y+1],f=s/2,h=h||a<0||null!=p[a+1],h=v<4?(null!=b||h)&&(0==v||v==(d.s<0?3:2)):b>f||b==f&&(4==v||h||6==v&&1&p[a-1]||v==(d.s<0?8:7)),a<1||!p[0])n=h?T(u.charAt(1),-y,u.charAt(0)):u.charAt(0);else{if(p.length=a,h)for(--s;++p[--a]>s;)p[a]=0,a||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(b=0,n="";b<=f;n+=u.charAt(p[b++]));n=T(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,s,o,c=0,u=e.length,a=t%g,l=t/g|0;for(e=e.slice();u--;)c=((i=a*(s=e[u]%g)+(n=l*s+(o=e[u]/g|0)*a)%g*g+c)/r|0)+(n/g|0)+l*o,e[u]=i%r;return c&&(e=[c].concat(e)),e}function t(e,t,r,n){var i,s;if(r!=n)s=r>n?1:-1;else for(i=s=0;it[i]?1:-1;break}return s}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(n,i,s,o,c){var a,l,d,p,g,b,m,v,_,w,E,T,A,S,O,j,k,N=n.s==i.s?1:-1,I=n.c,C=i.c;if(!(I&&I[0]&&C&&C[0]))return new z(n.s&&i.s&&(I?!C||I[0]!=C[0]:C)?I&&0==I[0]||!C?0*N:N/0:NaN);for(_=(v=new z(N)).c=[],N=s+(l=n.e-i.e)+1,c||(c=f,l=y(n.e/h)-y(i.e/h),N=N/h|0),d=0;C[d]==(I[d]||0);d++);if(C[d]>(I[d]||0)&&l--,N<0)_.push(1),p=!0;else{for(S=I.length,j=C.length,d=0,N+=2,(g=u(c/(C[0]+1)))>1&&(C=e(C,g,c),I=e(I,g,c),j=C.length,S=I.length),A=j,E=(w=I.slice(0,j)).length;E=c/2&&O++;do{if(g=0,(a=t(C,w,j,E))<0){if(T=w[0],j!=E&&(T=T*c+(w[1]||0)),(g=u(T/O))>1)for(g>=c&&(g=c-1),m=(b=e(C,g,c)).length,E=w.length;1==t(b,w,m,E);)g--,r(b,j=10;N/=10,d++);q(v,s+(v.e=d+l*h-1)+1,o,p)}else v.e=l,v.r=+p;return v}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,O=/^([^.]+)\.$/,j=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,N=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,s=r?t:t.replace(N,"");if(k.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(S,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,s=s.replace(O,"$1").replace(j,"0.$1")),t!=s))return new z(s,i);if(z.DEBUG)throw Error(a+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},I.absoluteValue=I.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},I.comparedTo=function(e,t){return v(this,new z(e,t))},I.decimalPlaces=I.dp=function(e,t){var r,n,i,s=this;if(null!=e)return _(e,0,b),null==t?t=B:_(t,0,8),q(new z(s),e+s.e+1,t);if(!(r=s.c))return null;if(n=((i=r.length-1)-y(this.e/h))*h,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},I.dividedBy=I.div=function(e,t){return r(this,new z(e,t),R,B)},I.dividedToIntegerBy=I.idiv=function(e,t){return r(this,new z(e,t),0,1)},I.exponentiatedBy=I.pow=function(e,t){var r,n,i,s,o,l,f,d,p=this;if((e=new z(e)).c&&!e.isInteger())throw Error(a+"Exponent not an integer: "+Y(e));if(null!=t&&(t=new z(t)),o=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return d=new z(Math.pow(+Y(p),o?e.s*(2-w(e)):+Y(e))),t?d.mod(t):d;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(n=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||o&&p.c[1]>=24e7:p.c[0]<8e13||o&&p.c[0]<=9999975e7)))return s=p.s<0&&w(e)?-0:0,p.e>-1&&(s=1/s),new z(l?1/s:s);G&&(s=c(G/h+2))}for(o?(r=new z(.5),l&&(e.s=1),f=w(e)):f=(i=Math.abs(+Y(e)))%2,d=new z(C);;){if(f){if(!(d=d.times(p)).c)break;s?d.c.length>s&&(d.c.length=s):n&&(d=d.mod(t))}if(i){if(0===(i=u(i/2)))break;f=i%2}else if(q(e=e.times(r),e.e+1,1),e.e>14)f=w(e);else{if(0===(i=+Y(e)))break;f=i%2}p=p.times(p),s?p.c&&p.c.length>s&&(p.c.length=s):n&&(p=p.mod(t))}return n?d:(l&&(d=C.div(d)),t?d.mod(t):s?q(d,G,B,undefined):d)},I.integerValue=function(e){var t=new z(this);return null==e?e=B:_(e,0,8),q(t,t.e+1,e)},I.isEqualTo=I.eq=function(e,t){return 0===v(this,new z(e,t))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(e,t){return v(this,new z(e,t))>0},I.isGreaterThanOrEqualTo=I.gte=function(e,t){return 1===(t=v(this,new z(e,t)))||0===t},I.isInteger=function(){return!!this.c&&y(this.e/h)>this.c.length-2},I.isLessThan=I.lt=function(e,t){return v(this,new z(e,t))<0},I.isLessThanOrEqualTo=I.lte=function(e,t){return-1===(t=v(this,new z(e,t)))||0===t},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return this.s>0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(e,t){var r,n,i,s,o=this,c=o.s;if(t=(e=new z(e,t)).s,!c||!t)return new z(NaN);if(c!=t)return e.s=-t,o.plus(e);var u=o.e/h,a=e.e/h,l=o.c,d=e.c;if(!u||!a){if(!l||!d)return l?(e.s=-t,e):new z(d?o:NaN);if(!l[0]||!d[0])return d[0]?(e.s=-t,e):new z(l[0]?o:3==B?-0:0)}if(u=y(u),a=y(a),l=l.slice(),c=u-a){for((s=c<0)?(c=-c,i=l):(a=u,i=d),i.reverse(),t=c;t--;i.push(0));i.reverse()}else for(n=(s=(c=l.length)<(t=d.length))?c:t,c=t=0;t0)for(;t--;l[r++]=0);for(t=f-1;n>c;){if(l[--n]=0;){for(r=0,p=T[i]%_,b=T[i]/_|0,s=i+(o=u);s>i;)r=((a=p*(a=E[--o]%_)+(c=b*a+(l=E[o]/_|0)*p)%_*_+m[s]+r)/v|0)+(c/_|0)+b*l,m[s--]=a%v;m[s]=r}return r?++n:m.splice(0,1),K(e,m,n)},I.negated=function(){var e=new z(this);return e.s=-e.s||null,e},I.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new z(e,t)).s,!i||!t)return new z(NaN);if(i!=t)return e.s=-t,n.minus(e);var s=n.e/h,o=e.e/h,c=n.c,u=e.c;if(!s||!o){if(!c||!u)return new z(i/0);if(!c[0]||!u[0])return u[0]?e:new z(c[0]?n:0*i)}if(s=y(s),o=y(o),c=c.slice(),i=s-o){for(i>0?(o=s,r=u):(i=-i,r=c),r.reverse();i--;r.push(0));r.reverse()}for((i=c.length)-(t=u.length)<0&&(r=u,u=c,c=r,t=i),i=0;t;)i=(c[--t]=c[t]+u[t]+i)/f|0,c[t]=f===c[t]?0:c[t]%f;return i&&(c=[i].concat(c),++o),K(e,c,o)},I.precision=I.sd=function(e,t){var r,n,i,s=this;if(null!=e&&e!==!!e)return _(e,1,b),null==t?t=B:_(t,0,8),q(new z(s),e,t);if(!(r=s.c))return null;if(n=(i=r.length-1)*h+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&s.e+1>n&&(n=s.e+1),n},I.shiftedBy=function(e){return _(e,-9007199254740991,d),this.times("1e"+e)},I.squareRoot=I.sqrt=function(){var e,t,n,i,s,o=this,c=o.c,u=o.s,a=o.e,l=R+4,f=new z("0.5");if(1!==u||!c||!c[0])return new z(!u||u<0&&(!c||c[0])?NaN:c?o:1/0);if(0==(u=Math.sqrt(+Y(o)))||u==1/0?(((t=m(c)).length+a)%2==0&&(t+="0"),u=Math.sqrt(+t),a=y((a+1)/2)-(a<0||a%2),n=new z(t=u==1/0?"5e"+a:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+a)):n=new z(u+""),n.c[0])for((u=(a=n.e)+l)<3&&(u=0);;)if(s=n,n=f.times(s.plus(r(o,s,l,1))),m(s.c).slice(0,u)===(t=m(n.c)).slice(0,u)){if(n.e0&&g>0){for(s=g%c||c,f=p.substr(0,s);s0&&(f+=l+p.slice(s)),d&&(f="-"+f)}n=h?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):f}return(r.prefix||"")+n+(r.suffix||"")},I.toFraction=function(e){var t,n,i,s,o,c,u,l,f,d,g,b,y=this,v=y.c;if(null!=e&&(!(u=new z(e)).isInteger()&&(u.c||1!==u.s)||u.lt(C)))throw Error(a+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Y(u));if(!v)return new z(y);for(t=new z(C),f=n=new z(C),i=l=new z(C),b=m(v),o=t.e=b.length-y.e-1,t.c[0]=p[(c=o%h)<0?h+c:c],e=!e||u.comparedTo(t)>0?o>0?t:f:u,c=x,x=1/0,u=new z(b),l.c[0]=0;d=r(u,t,0,1),1!=(s=n.plus(d.times(i))).comparedTo(e);)n=i,i=s,f=l.plus(d.times(s=f)),l=s,t=u.minus(d.times(s=t)),u=s;return s=r(e.minus(n),i,0,1),l=l.plus(s.times(f)),n=n.plus(s.times(i)),l.s=f.s=y.s,g=r(f,i,o*=2,B).minus(y).abs().comparedTo(r(l,n,o,B).minus(y).abs())<1?[f,i]:[l,n],x=c,g},I.toNumber=function(){return+Y(this)},I.toPrecision=function(e,t){return null!=e&&_(e,1,b),W(this,e,t,2)},I.toString=function(e){var t,r=this,i=r.s,s=r.e;return null===s?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=s<=P||s>=U?E(m(r.c),s):T(m(r.c),s,"0"):10===e&&$?t=T(m((r=q(new z(r),R+s+1,B)).c),r.e,"0"):(_(e,2,H.length,"Base"),t=n(T(m(r.c),s,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},I.valueOf=I.toJSON=function(){return Y(this)},I._isBigNumber=!0,null!=t&&z.set(t),z}(),s.default=s.BigNumber=s,void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},"../../node_modules/buffer/index.js":(e,t,r)=>{"use strict"; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +const n=r("../../node_modules/base64-js/index.js"),i=r("../../node_modules/ieee754/index.js"),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=Buffer,t.h2=50;const o=2147483647;function c(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|p(e,t);let n=c(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);const i=function(e){if(Buffer.isBuffer(e)){const t=0|d(e.length),r=c(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?c(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return a(e),c(e<0?0:0|d(e))}function f(e){const t=e.length<0?0:0|d(e.length),r=c(t);for(let n=0;n=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function p(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(i)return n?-1:W(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return j(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){let s,o=1,c=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,c/=2,u/=2,r/=2}function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(s=r;sc&&(r=c-u),s=r;s>=0;s--){let r=!0;for(let n=0;ni&&(n=i):n=i;const s=t.length;let o;for(n>s/2&&(n=s/2),o=0;o>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,c,u;switch(o){case 1:t<128&&(s=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(s=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:r=e[i+1],n=e[i+2],c=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&c)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&c,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(Buffer.isBuffer(t)||(t=Buffer.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!Buffer.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},Buffer.byteLength=p,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},s&&(Buffer.prototype[s]=Buffer.prototype.inspect),Buffer.prototype.compare=function(e,t,r,n,i){if(q(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0);const c=Math.min(s,o),u=this.slice(n,i),a=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function j(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,s){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function B(e,t,r,n,i){D(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function P(e,t,r,n,i){D(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function U(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,s){return t=+t,r>>>=0,s||U(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function x(e,t,r,n,s){return t=+t,r>>>=0,s||U(e,0,r,8),i.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,s=0;for(;++s>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readBigUInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,s=0;for(;++s=i&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readBigInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,!n){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigUInt64LE=J((function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeBigUInt64BE=J((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i>0)-o&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s>>0)-o&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigInt64LE=J((function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeBigInt64BE=J((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function D(e,t,r,n,i,s){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new L.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,s)}function H(e,t){if("number"!=typeof e)throw new L.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new L.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new L.ERR_BUFFER_OUT_OF_BOUNDS;throw new L.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=G(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=G(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function W(e,t){let r;t=t||1/0;const n=e.length;let i=null;const s=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function V(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function J(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},"../../node_modules/es6-promise/dist/es6-promise.js":function(e,t,r){var n=r("../../node_modules/process/browser.js"); +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.8+1e68dce6 + */e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var i=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=0,o=void 0,c=void 0,u=function(e,t){w[s]=e,w[s+1]=t,2===(s+=2)&&(c?c(E):A())};function a(e){c=e}function l(e){u=e}var f="undefined"!=typeof window?window:void 0,h=f||{},d=h.MutationObserver||h.WebKitMutationObserver,p="undefined"==typeof self&&"[object process]"==={}.toString.call(n),g="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function b(){return function(){return n.nextTick(E)}}function y(){return void 0!==o?function(){o(E)}:_()}function m(){var e=0,t=new d(E),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function v(){var e=new MessageChannel;return e.port1.onmessage=E,function(){return e.port2.postMessage(0)}}function _(){var e=setTimeout;return function(){return e(E,1)}}var w=new Array(1e3);function E(){for(var e=0;e{"use strict";var n,i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,s="object"==typeof Reflect?Reflect:null,o=s&&"function"==typeof s.apply?s.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var c=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,e.exports.once=function(e,t){return new i((function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}m(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,r)}(e,i,{once:!0})}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,events,s,o;if(l(r),void 0===(events=e._events)?(events=e._events=Object.create(null),e._eventsCount=0):(void 0!==events.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),events=e._events),s=events[t]),void 0===s)s=events[t]=r,++e._eventsCount;else if("function"==typeof s?s=events[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=f(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,o=c,console&&console.warn&&console.warn(o)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function g(e,t,r){var events=e._events;if(void 0===events)return[];var n=events[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var c=events[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var u=c.length,a=y(c,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return g(this,e,!0)},u.prototype.rawListeners=function(e){return g(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):b.call(e,t)},u.prototype.listenerCount=b,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},"../../node_modules/ieee754/index.js":(e,t)=>{ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +t.read=function(e,t,r,n,i){var s,o,c=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,s=d&(1<<-l)-1,d>>=-l,l+=c;l>0;s=256*s+e[t+f],f+=h,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===s)s=1-a;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=a}return(d?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var o,c,u,a=8*s-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(c=0,o=l):o+f>=1?(c=(t*u-1)*Math.pow(2,i),o+=f):(c=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&c,d+=p,c/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,a-=8);e[r+d-p]|=128*g}},"../../node_modules/process/browser.js":e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,u=[],a=!1,l=-1;function f(){a&&c&&(a=!1,c.length?u=c.concat(u):l=-1,u.length&&h())}function h(){if(!a){var e=o(f);a=!0;for(var t=u.length;t;){for(c=u,u=[];++l1)for(var r=1;r{if(!r.tx)return;const n=r.address,i=e.getAccount(n);t({id:-1,type:c.RESPONSES.NOTIFICATION,payload:{type:"notification",payload:{descriptor:i?i.descriptor:n,tx:i?l.transformTransaction(i.descriptor,i.addresses,r.tx):l.transformTransaction(n,void 0,r.tx)}}})},h=async e=>{if(e.state.getSubscription("block"))return{subscribed:!0};const t=await e.connect();return e.state.addSubscription("block"),t.on("block",(t=>(({post:e},t)=>{e({id:-1,type:c.RESPONSES.NOTIFICATION,payload:{type:"block",payload:{blockHeight:t.height,blockHash:t.hash}}})})(e,t))),t.subscribeBlock()},d=async(e,t)=>{const r=await e.connect();return e.state.getSubscription("fiatRates")||(e.state.addSubscription("fiatRates"),r.on("fiatRates",(t=>(({post:e},t)=>{e({id:-1,type:c.RESPONSES.NOTIFICATION,payload:{type:"fiatRates",payload:{rates:t.rates}}})})(e,t)))),r.subscribeFiatRates(t)},p=async e=>{const t=await e.connect();return e.state.getSubscription("mempool")||(e.state.addSubscription("mempool"),t.on("mempool",(t=>(({post:e},t)=>{e({id:-1,type:c.RESPONSES.NOTIFICATION,payload:{type:"mempool",payload:t}})})(e,t)))),t.subscribeMempool()},g=async e=>{const{payload:t}=e;let r;if("accounts"===t.type)r=await(async(e,t)=>{const r=await e.connect(),{state:n}=e;return n.addAccounts(t),n.getSubscription("notification")||(r.on("notification",(t=>f(e,t))),n.addSubscription("notification")),r.subscribeAddresses(n.getAddresses())})(e,t.accounts);else if("addresses"===t.type)r=await(async(e,t)=>{const r=await e.connect(),{state:n}=e;return n.addAddresses(t),n.getSubscription("notification")||(r.on("notification",(t=>f(e,t))),n.addSubscription("notification")),r.subscribeAddresses(n.getAddresses())})(e,t.addresses);else if("block"===t.type)r=await h(e);else if("fiatRates"===t.type)r=await d(e,t.currency);else{if("mempool"!==t.type)throw new o.CustomError("invalid_param","+type");r=await p(e)}return{type:c.RESPONSES.SUBSCRIBE,payload:r}},b=e=>{switch(e.type){case c.MESSAGES.GET_INFO:return(async e=>{const t=await e.connect(),r=await t.getServerInfo();return{type:c.RESPONSES.GET_INFO,payload:Object.assign({url:t.options.url},l.transformServerInfo(r))}})(e);case c.MESSAGES.GET_BLOCK_HASH:return(async e=>{const t=await e.connect(),r=await t.getBlockHash(e.payload);return{type:c.RESPONSES.GET_BLOCK_HASH,payload:r.hash}})(e);case c.MESSAGES.GET_BLOCK:return(async e=>{const t=await e.connect(),r=await t.getBlock(e.payload);return{type:c.RESPONSES.GET_BLOCK,payload:r}})(e);case c.MESSAGES.GET_ACCOUNT_INFO:return(async e=>{const{payload:t}=e,r=await e.connect(),n=await r.getAccountInfo(t);return{type:c.RESPONSES.GET_ACCOUNT_INFO,payload:l.transformAccountInfo(n)}})(e);case c.MESSAGES.GET_ACCOUNT_UTXO:return(async e=>{const{payload:t}=e,r=await e.connect(),n=await r.getAccountUtxo(t);return{type:c.RESPONSES.GET_ACCOUNT_UTXO,payload:l.transformAccountUtxo(n)}})(e);case c.MESSAGES.GET_TRANSACTION:return(async e=>{const t=await e.connect(),r=await t.getTransaction(e.payload);return{type:c.RESPONSES.GET_TRANSACTION,payload:{type:"blockbook",tx:r}}})(e);case c.MESSAGES.GET_ACCOUNT_BALANCE_HISTORY:return(async e=>{const{payload:t}=e,r=await e.connect(),n=await r.getAccountBalanceHistory(t);return{type:c.RESPONSES.GET_ACCOUNT_BALANCE_HISTORY,payload:n}})(e);case c.MESSAGES.GET_CURRENT_FIAT_RATES:return(async e=>{const{payload:t}=e,r=await e.connect(),n=await r.getCurrentFiatRates(t);return{type:c.RESPONSES.GET_CURRENT_FIAT_RATES,payload:n}})(e);case c.MESSAGES.GET_FIAT_RATES_FOR_TIMESTAMPS:return(async e=>{const{payload:t}=e,r=await e.connect(),{tickers:n}=await r.getFiatRatesForTimestamps(t);return{type:c.RESPONSES.GET_FIAT_RATES_FOR_TIMESTAMPS,payload:{tickers:n}}})(e);case c.MESSAGES.GET_FIAT_RATES_TICKERS_LIST:return(async e=>{const{payload:t}=e,r=await e.connect(),n=await r.getFiatRatesTickersList(t);return{type:c.RESPONSES.GET_FIAT_RATES_TICKERS_LIST,payload:{ts:n.ts,availableCurrencies:n.available_currencies}}})(e);case c.MESSAGES.ESTIMATE_FEE:return(async e=>{const t=await e.connect(),r=await t.estimateFee(e.payload);return{type:c.RESPONSES.ESTIMATE_FEE,payload:r}})(e);case c.MESSAGES.PUSH_TRANSACTION:return(async e=>{const t=await e.connect(),r=await t.pushTransaction(e.payload);return{type:c.RESPONSES.PUSH_TRANSACTION,payload:r.result}})(e);case c.MESSAGES.SUBSCRIBE:return g(e);case c.MESSAGES.UNSUBSCRIBE:return(async e=>{const{payload:t}=e;let r;if("accounts"===t.type)r=await(async({state:e,connect:t},r)=>{e.removeAccounts(r||e.getAccounts());const n=await t(),i=e.getAddresses();return i.length<1?(n.removeAllListeners("notification"),e.removeSubscription("notification"),n.unsubscribeAddresses()):n.subscribeAddresses(i)})(e,t.accounts);else if("addresses"===t.type)r=await(async({state:e,connect:t},r)=>{const n=await t();r||e.removeAccounts(e.getAccounts());const i=e.removeAddresses(r||e.getAddresses());return i.length<1?(n.removeAllListeners("notification"),e.removeSubscription("notification"),n.unsubscribeAddresses()):n.subscribeAddresses(i)})(e,t.addresses);else if("block"===t.type)r=await(async({state:e,connect:t})=>{if(!e.getSubscription("block"))return{subscribed:!1};const r=await t();return r.removeAllListeners("block"),e.removeSubscription("block"),r.unsubscribeBlock()})(e);else if("fiatRates"===t.type)r=await(async({state:e,connect:t})=>{if(!e.getSubscription("fiatRates"))return{subscribed:!1};const r=await t();return r.removeAllListeners("fiatRates"),e.removeSubscription("fiatRates"),r.unsubscribeFiatRates()})(e);else{if("mempool"!==t.type)throw new o.CustomError("invalid_param","+type");r=await(async({state:e,connect:t})=>{if(!e.getSubscription("mempool"))return{subscribed:!1};const r=await t();return r.removeAllListeners("mempool"),e.removeSubscription("mempool"),r.unsubscribeMempool()})(e)}return{type:c.RESPONSES.UNSUBSCRIBE,payload:r}})(e);default:throw new o.CustomError("worker_unknown_request",`+${e.type}`)}};class y extends u.BaseWorker{cleanup(){this.api&&(this.api.dispose(),this.api.removeAllListeners()),super.cleanup()}isConnected(e){var t;return null!==(t=null==e?void 0:e.isConnected())&&void 0!==t&&t}async tryConnect(e){const{timeout:t,pingTimeout:r,keepAlive:n}=this.settings,i=new a.BlockbookAPI({url:e,timeout:t,pingTimeout:r,keepAlive:n,agent:this.proxyAgent});return await i.connect(),i.on("disconnected",(()=>{this.post({id:-1,type:c.RESPONSES.DISCONNECTED,payload:!0}),this.cleanup()})),this.post({id:-1,type:c.RESPONSES.CONNECTED}),i}disconnect(){this.api&&this.api.disconnect()}async messageHandler(e){try{if(await super.messageHandler(e))return!0;const t=Object.assign(Object.assign({},e.data),{connect:()=>this.connect(),post:e=>this.post(e),state:this.state}),r=await b(t);this.post(Object.assign({id:e.data.id},r))}catch(t){this.errorResponse(e.data.id,t)}}}if(t.default=function(){return new y},"worker"===u.CONTEXT){const e=new y;onmessage=e.messageHandler.bind(e)}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();r("../blockchain-link/lib/workers/blockbook/index.js")})(); \ No newline at end of file diff --git a/app/trezor-prebuild/build/workers/blockfrost-worker.82cb4a83f1909b418465.js b/app/trezor-prebuild/build/workers/blockfrost-worker.82cb4a83f1909b418465.js new file mode 100644 index 0000000000..fb26aaf6d3 --- /dev/null +++ b/app/trezor-prebuild/build/workers/blockfrost-worker.82cb4a83f1909b418465.js @@ -0,0 +1,17 @@ +(()=>{var t={"../blockchain-link-types/lib/constants/errors.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomError=void 0;const r="blockchain_link/",n={worker_not_found:"Worker not found",worker_invalid:"Invalid worker object",worker_timeout:"Worker timeout",worker_unknown_request:"Unknown message type:",worker_runtime:void 0,invalid_param:"Invalid parameter:",websocket_not_initialized:"WebSocket not initialized",websocket_no_url:"Cannot connect because no server was specified",websocket_timeout:"Websocket timeout",websocket_error_message:void 0,websocket_runtime_error:void 0};class i extends Error{constructor(t,e=""){if(super(e),this.message="",this.message=e,"string"==typeof t){const i=0===t.indexOf(r)?t.substring(16,t.length):t;this.code=`${r}${i}`;const s=n[i];"string"==typeof s&&(""===this.message?this.message=s:0===e.indexOf("+")&&(this.message=`${s} ${e.substring(1)}`))}"string"==typeof this.message&&""!==this.message||(this.message="Message not set")}}e.CustomError=i},"../blockchain-link-types/lib/constants/index.js":function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.NETWORKS=e.RESPONSES=e.MESSAGES=void 0;const o=s(r("../blockchain-link-types/lib/constants/messages.js"));e.MESSAGES=o;const u=s(r("../blockchain-link-types/lib/constants/responses.js"));e.RESPONSES=u,e.NETWORKS={RIPPLE:"ripple",BLOCKBOOK:"blockbook",BLOCKFROST:"blockfrost"}},"../blockchain-link-types/lib/constants/messages.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TERMINATE=e.PUSH_TRANSACTION=e.UNSUBSCRIBE=e.SUBSCRIBE=e.ESTIMATE_FEE=e.GET_TRANSACTION=e.GET_ACCOUNT_UTXO=e.GET_ACCOUNT_INFO=e.GET_BLOCK=e.GET_BLOCK_HASH=e.GET_FIAT_RATES_TICKERS_LIST=e.GET_ACCOUNT_BALANCE_HISTORY=e.GET_FIAT_RATES_FOR_TIMESTAMPS=e.GET_CURRENT_FIAT_RATES=e.GET_INFO=e.DISCONNECT=e.CONNECT=e.INIT=e.HANDSHAKE=void 0,e.HANDSHAKE="m_handshake",e.INIT="m_init",e.CONNECT="m_connect",e.DISCONNECT="m_disconnect",e.GET_INFO="m_get_info",e.GET_CURRENT_FIAT_RATES="m_get_current_fiat_rates",e.GET_FIAT_RATES_FOR_TIMESTAMPS="m_get_fiat_rates_for_timestamps",e.GET_ACCOUNT_BALANCE_HISTORY="m_get_account_balance_history",e.GET_FIAT_RATES_TICKERS_LIST="m_get_fiat_rates_tickers_list",e.GET_BLOCK_HASH="m_get_block_hash",e.GET_BLOCK="m_get_block",e.GET_ACCOUNT_INFO="m_get_account_info",e.GET_ACCOUNT_UTXO="m_get_account_utxo",e.GET_TRANSACTION="m_get_transaction",e.ESTIMATE_FEE="m_estimate_fee",e.SUBSCRIBE="m_subscribe",e.UNSUBSCRIBE="m_unsubscribe",e.PUSH_TRANSACTION="m_push_tx",e.TERMINATE="terminate"},"../blockchain-link-types/lib/constants/responses.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NOTIFICATION=e.DISCONNECTED=e.CONNECTED=e.PUSH_TRANSACTION=e.UNSUBSCRIBE=e.SUBSCRIBE=e.ESTIMATE_FEE=e.GET_TRANSACTION=e.GET_ACCOUNT_BALANCE_HISTORY=e.GET_ACCOUNT_UTXO=e.GET_ACCOUNT_INFO=e.GET_FIAT_RATES_TICKERS_LIST=e.GET_FIAT_RATES_FOR_TIMESTAMPS=e.GET_CURRENT_FIAT_RATES=e.GET_BLOCK=e.GET_BLOCK_HASH=e.GET_INFO=e.CONNECT=e.ERROR=void 0,e.ERROR="r_error",e.CONNECT="r_connect",e.GET_INFO="r_info",e.GET_BLOCK_HASH="r_get_block_hash",e.GET_BLOCK="r_get_block",e.GET_CURRENT_FIAT_RATES="r_get_current_fiat_rates",e.GET_FIAT_RATES_FOR_TIMESTAMPS="r_get_fiat_rates_for_timestamps",e.GET_FIAT_RATES_TICKERS_LIST="r_GET_FIAT_RATES_TICKERS_LIST",e.GET_ACCOUNT_INFO="r_account_info",e.GET_ACCOUNT_UTXO="r_get_account_utxo",e.GET_ACCOUNT_BALANCE_HISTORY="r_get_account_balance_history",e.GET_TRANSACTION="r_get_transaction",e.ESTIMATE_FEE="r_estimate_fee",e.SUBSCRIBE="r_subscribe",e.UNSUBSCRIBE="r_unsubscribe",e.PUSH_TRANSACTION="r_push_tx",e.CONNECTED="r_connected",e.DISCONNECTED="r_disconnected",e.NOTIFICATION="r_notification"},"../blockchain-link-utils/lib/blockfrost.js":function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.transformAccountInfo=e.transformTransaction=e.filterTokenTransfers=e.transformInputOutput=e.transformTokenInfo=e.parseAsset=e.getSubtype=e.transformUtxos=void 0;const i=n(r("../../node_modules/bignumber.js/bignumber.js")),s=r("../blockchain-link-utils/lib/utils.js");e.transformUtxos=t=>{const e=[];return t.forEach((t=>t.utxoData.amount.forEach((r=>{e.push({address:t.address,txid:t.utxoData.tx_hash,confirmations:t.blockInfo.confirmations,blockHeight:t.blockInfo.height||0,amount:r.quantity,vout:t.utxoData.output_index,path:t.path,cardanoSpecific:{unit:r.unit}})})))),e};e.getSubtype=t=>{if(t.txData.withdrawal_count>0)return"withdrawal";const e=t.txData.stake_cert_count,r=t.txData.delegation_count;return 0===e&&0===r?null:e>0?new i.default(t.txData.deposit).gt(0)?"stake_registration":"stake_deregistration":r>0?"stake_delegation":null};e.parseAsset=t=>({policyId:t.slice(0,56),assetName:(t=>{let e="";for(let r=0;r{if(!t||!Array.isArray(t))return;const r=t.map((t=>{const{assetName:r}=(0,e.parseAsset)(t.unit);return{type:"BLOCKFROST",name:t.fingerprint,contract:t.unit,symbol:r||t.fingerprint,balance:t.quantity,decimals:t.decimals}}));return r.length>0?r:void 0};e.transformInputOutput=(t,e="lovelace")=>t.map((t=>{var r,n;return{n:t.output_index,addresses:[t.address],isAddress:!0,value:null!==(n=null===(r=t.amount.find((t=>t.unit===e)))||void 0===r?void 0:r.quantity)&&void 0!==n?n:"0"}}));e.filterTokenTransfers=(t,r,n)=>{const i=[],o=t.used.concat(t.unused),u=t.change.concat(o);return r.txUtxos.outputs.forEach((c=>{c.amount.filter((t=>"lovelace"!==t.unit)).forEach((a=>{var l;const f=a.unit,h=(0,e.transformInputOutput)(r.txUtxos.inputs,f),d=(0,e.transformInputOutput)(r.txUtxos.outputs,f),p=(0,s.filterTargets)(u,h),g=(0,s.filterTargets)(u,d),y=t.change.find((t=>t.address===c.address));if(0===g.length&&0===p.length)return null;const b=(0,s.filterTargets)(o,(0,e.transformInputOutput)([c],f));let m="0";if("sent"===n?m=y?"0":a.quantity:"recv"===n?m=b.reduce(s.sumVinVout,0).toString():"self"!==n||y||(m=b.reduce(s.sumVinVout,0).toString()),"0"===m||!a.fingerprint)return null;const{assetName:v}=(0,e.parseAsset)(f);i.push({type:n,name:a.fingerprint,symbol:v||a.fingerprint,contract:a.unit,decimals:a.decimals,amount:m.toString(),from:"sent"===n||"self"===n?r.address:(null===(l=r.txUtxos.inputs.find((t=>t.amount.find((t=>t.unit===f)))))||void 0===l?void 0:l.address)||"",to:"recv"===n?r.address:c.address})}))})),i.filter((t=>!!t))};e.transformTransaction=(t,r,n)=>{var o;const u=r?r.change.concat(r.used,r.unused).map((t=>t.address)):[t];let c,a=[],l=(null===(o=n.txData.output_amount.find((t=>"lovelace"===t.unit)))||void 0===o?void 0:o.quantity)||"0";const f=n.txData.fees;let h,d;const p=(0,e.transformInputOutput)(n.txUtxos.inputs),g=(0,e.transformInputOutput)(n.txUtxos.outputs),y=Array.isArray(p)?p.length:0,b=Array.isArray(g)?g.length:0,m=(0,s.filterTargets)(u,p),v=(0,s.filterTargets)(u,g),_=r?(0,s.filterTargets)(r.change,g):[],w=p.reduce(s.sumVinVout,0),E=g.reduce(s.sumVinVout,0);if(0===m.length&&0===v.length)c="unknown";else if(y>0&&b>0&&m.length===y&&v.length===b)c="self",a=g.filter((t=>_.indexOf(t)<0)),l=n.txData.fees,n.txData.withdrawal_count>0&&(h=new i.default(E).plus(n.txData.fees).minus(w).toString()),new i.default(n.txData.deposit).gt(0)&&(d=n.txData.deposit);else if(0===m.length&&v.length>0)c="recv",l="0",v.length>0&&(a=v,l=v.reduce(s.sumVinVout,0));else if(c="sent",a=g.filter((t=>_.indexOf(t)<0)),b){const t=m.reduce(s.sumVinVout,0),e=v.reduce(s.sumVinVout,0);l=new i.default(t).minus(e).minus(null!=f?f:"0")}const A=r?(0,e.filterTokenTransfers)(r,n,c):[];return{type:c,txid:n.txHash,blockTime:n.txData.block_time,blockHeight:n.txData.block_height||void 0,blockHash:n.txData.block,amount:null==l?void 0:l.toString(),fee:f,targets:a.map((t=>(0,s.transformTarget)(t,v))),tokens:A,internalTransfers:[],cardanoSpecific:{subtype:(0,e.getSubtype)(n),withdrawal:h,deposit:d},feeRate:void 0,details:{vin:p.map((0,s.enhanceVinVout)(u)),vout:g.map((0,s.enhanceVinVout)(u)),size:n.txData.size,totalInput:w.toString(),totalOutput:E.toString()}}};e.transformAccountInfo=t=>{const r=t.history.transactions;return Object.assign(Object.assign({},t),{tokens:(0,e.transformTokenInfo)(t.tokens),history:Object.assign(Object.assign({},t.history),{transactions:r?null==r?void 0:r.map((r=>(0,e.transformTransaction)(t.descriptor,t.addresses,r))):[]})})}},"../blockchain-link-utils/lib/utils.js":function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.sortTxsFromLatest=e.transformTarget=e.sumVinVout=e.enhanceVinVout=e.filterTargets=e.isAccountOwned=void 0;const i=n(r("../../node_modules/bignumber.js/bignumber.js")),s=r("../utils/lib/index.js");e.isAccountOwned=t=>e=>Array.isArray(null==e?void 0:e.addresses)&&e.addresses.some((e=>t.includes(e)));e.filterTargets=(t,r)=>{if("string"==typeof t&&(t=[t]),!(t&&Array.isArray(t)&&r&&Array.isArray(r)))return[];const n=t.map((t=>"string"==typeof t?t:"object"==typeof t&&"string"==typeof t.address?t.address:void 0)).filter(s.isNotUndefined);return r.filter((0,e.isAccountOwned)(n))};e.enhanceVinVout=t=>r=>Object.assign(Object.assign({},r),{isAccountOwned:(0,e.isAccountOwned)(t)(r)||void 0});e.sumVinVout=(t,{value:e})=>"string"==typeof e?new i.default(e||"0").plus(t):t;e.transformTarget=(t,e)=>({n:t.n||0,addresses:t.addresses,isAddress:t.isAddress,amount:t.value,coinbase:t.coinbase,isAccountTarget:!!e.includes(t)||void 0});const o=({blockHeight:t})=>void 0===t||t<=0?Number.MAX_SAFE_INTEGER:t;e.sortTxsFromLatest=t=>{const e=t.slice().sort(((t,e)=>o(e)-o(t)));let r=0;for(;rt.details.vin.some((({txid:t})=>t===e.txid))));e.splice(r,i.length,...i)}r=n}return e}},"../blockchain-link/lib/utils/socks-proxy-agent.js":t=>{"use strict";t.exports=t=>({})},"../blockchain-link/lib/utils/ws.js":(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r("../../node_modules/events/events.js");class i extends n.EventEmitter{constructor(t,e,r){super(),this._ws=new WebSocket(t),this._ws.onclose=()=>{this.emit("close")},this._ws.onopen=()=>{this.emit("open")},this._ws.onerror=t=>{this.emit("error",new Error(`WsWrapper error. Ready state: ${this.readyState}`))},this._ws.onmessage=t=>{this.emit("message",t.data)}}close(){1===this.readyState&&this._ws.close()}send(t){this._ws.send(t)}get readyState(){return this._ws.readyState}}i.CONNECTING=0,i.OPEN=1,i.CLOSING=2,i.CLOSED=3,e.default=i},"../blockchain-link/lib/workers/baseWebsocket.js":function(t,e,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseWebsocket=void 0;const s=i(r("../blockchain-link/lib/utils/ws.js")),o=r("../utils/lib/createDeferred.js"),u=r("../utils/lib/typedEventEmitter.js"),c=r("../blockchain-link-types/lib/constants/errors.js");class a extends u.TypedEmitter{constructor(t){super(),this.messages=[],this.subscriptions=[],this.emitter=this,this.messageID=0,this.options=t}setConnectionTimeout(t){this.clearConnectionTimeout(),this.connectionTimeout=setTimeout(this.onTimeout.bind(this),t||this.options.timeout||2e4)}clearConnectionTimeout(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=void 0)}setPingTimeout(){this.pingTimeout&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(this.onPing.bind(this),this.options.pingTimeout||5e4)}rejectAllPending(t,e){this.messages.forEach((r=>r.reject(new c.CustomError(t,e)))),this.messages.splice(0,this.messages.length)}onTimeout(){const{ws:t}=this;if(t)if(t.listenerCount("open")>0){t.emit("error",new c.CustomError("websocket_timeout"));try{t.close()}catch(t){}}else this.rejectAllPending("websocket_timeout"),t.close()}async onPing(){if(this.ws&&this.isConnected())try{this.subscriptions.length>0||this.options.keepAlive?await this.ping():this.ws.close()}catch(t){}}onError(){this.onClose()}sendMessage(t){var e,r;const{ws:n}=this;if(!n)throw new c.CustomError("websocket_not_initialized");const i=this.messageID.toString(),s=(0,o.createDeferred)(i),u=Object.assign({id:i},t);return this.messageID++,this.messages.push(s),this.setConnectionTimeout(),this.setPingTimeout(),null===(r=(e=this.options).onSending)||void 0===r||r.call(e,t),n.send(JSON.stringify(u)),s.promise}onMessage(t){try{const e=JSON.parse(t),{id:r,data:n}=e,i=this.messages.find((t=>t.id===r));if(i)n.error?i.reject(new c.CustomError("websocket_error_message",n.error.message)):i.resolve(n),this.messages.splice(this.messages.indexOf(i),1);else{const t=this.subscriptions.find((t=>t.id===r));t&&t.callback(n)}}catch(t){}0===this.messages.length&&this.clearConnectionTimeout(),this.setPingTimeout()}addSubscription(t,e){const r=this.messageID.toString();this.subscriptions.push({id:r,type:t,callback:e})}removeSubscription(t){const e=this.subscriptions.findIndex((e=>e.type===t));return e>=0&&this.subscriptions.splice(e,1),e}async connect(){var t;if(this.connectPromise)return this.connectPromise;(null===(t=this.ws)||void 0===t?void 0:t.readyState)===s.default.CLOSING&&await new n((t=>this.emitter.once("disconnected",t))),this.setConnectionTimeout(this.options.connectionTimeout);const e=(0,o.createDeferred)(-1);this.connectPromise=e.promise;const r=this.createWebsocket();return r.once("error",(t=>{this.onClose(),e.reject(new c.CustomError("websocket_runtime_error",t.message))})),r.on("open",(()=>{this.init(),e.resolve()})),this.ws=r,e.promise.finally((()=>{this.connectPromise=void 0}))}init(){const{ws:t}=this;if(!t||!this.isConnected())throw Error("Websocket init cannot be called");this.clearConnectionTimeout(),t.removeAllListeners(),t.on("error",this.onError.bind(this)),t.on("message",this.onMessage.bind(this)),t.on("close",(()=>{this.onClose(),this.emitter.emit("disconnected")}))}disconnect(){var t;null===(t=this.ws)||void 0===t||t.close()}isConnected(){var t;return(null===(t=this.ws)||void 0===t?void 0:t.readyState)===s.default.OPEN}onClose(){var t;this.pingTimeout&&clearTimeout(this.pingTimeout),this.connectionTimeout&&clearTimeout(this.connectionTimeout),this.isConnected()&&this.disconnect(),null===(t=this.ws)||void 0===t||t.removeAllListeners(),this.rejectAllPending("websocket_runtime_error","Websocket closed unexpectedly")}dispose(){this.onClose(),this.removeAllListeners()}}e.BaseWebsocket=a},"../blockchain-link/lib/workers/baseWorker.js":function(t,e,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseWorker=e.CONTEXT=void 0;const s=i(r("../blockchain-link/lib/utils/socks-proxy-agent.js")),o=r("../blockchain-link-types/lib/constants/errors.js"),u=r("../blockchain-link/lib/workers/state.js"),c=r("../blockchain-link/lib/workers/utils.js"),a=r("../blockchain-link-types/lib/constants/index.js");e.CONTEXT="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope||"undefined"!=typeof importScripts?"worker":"main";e.BaseWorker=class{constructor(){this.settings={},"worker"===e.CONTEXT?this.post=t=>self.postMessage(t):this.post=t=>this.onmessage({data:t}),this.state=new u.WorkerState,setTimeout((()=>{this.post({id:-1,type:a.MESSAGES.HANDSHAKE})}),10)}debug(...t){if(!this.settings.debug)return;const e=`[Worker "${this.settings.name}"]:`,r=t[0];"warn"===r||"error"===r?console[r](e,...t.slice(1)):console.log(e,...t)}cleanup(){this.api=void 0,this.state.cleanup()}connect(){if(this.isConnected(this.api))return n.resolve(this.api);if(!this.connectPromise){const t=Array.isArray(this.settings.server)?this.settings.server.filter((t=>"string"==typeof t)):[];if(t.length<1)throw new o.CustomError("connect","Endpoint not set");const e=(0,c.prioritizeEndpoints)(t);this.connectPromise=this.connectRecursive(e).then((t=>(this.debug("Connected"),this.api=t,this.connectPromise=void 0,t)))}return this.connectPromise}connectRecursive([t,...e]){if(!t)throw new o.CustomError("connect","All backends are down");return this.proxyAgent&&(this.proxyAgent.protocol=/^(https|wss):/.test(t)?"https:":"http:"),this.debug("Connecting to",t),this.tryConnect(t).catch((t=>(this.debug("Connection failed",t),this.connectRecursive(e))))}disconnect(){}async messageHandler(t){if(!t.data)return!0;const{data:e}=t,{id:r}=e;return this.debug("onmessage",e),e.type===a.MESSAGES.HANDSHAKE?(this.settings=e.settings,this.proxyAgent=e.settings.proxy?(0,s.default)(e.settings.proxy):void 0,!0):e.type===a.MESSAGES.CONNECT?(await this.connect(),this.post({id:r,type:a.RESPONSES.CONNECT,payload:!0}),!0):e.type===a.MESSAGES.DISCONNECT?(this.disconnect(),this.post({id:r,type:a.RESPONSES.DISCONNECTED,payload:!0}),!0):e.type===a.MESSAGES.TERMINATE?(this.disconnect(),this.cleanup(),!0):void 0}errorResponse(t,e){const r={code:"",message:""};e instanceof Error&&(r.message=e.message,r.code=e instanceof o.CustomError&&e.code?e.code:""),this.post({id:t,type:a.RESPONSES.ERROR,payload:r})}postMessage(t){this.messageHandler({data:t})}onmessage(t){}onmessageerror(t){}onerror(t){}terminate(){this.postMessage({id:-1,type:a.MESSAGES.TERMINATE})}}},"../blockchain-link/lib/workers/blockfrost/websocket.js":function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BlockfrostAPI=void 0;const i=n(r("../blockchain-link/lib/utils/ws.js")),s=r("../blockchain-link/lib/workers/baseWebsocket.js");class o extends s.BaseWebsocket{constructor(){super(...arguments),this.send=(t,e={})=>this.sendMessage({command:t,params:e})}createWebsocket(){const{url:t}=this.options;return new i.default(t,{agent:this.options.agent})}ping(){return this.getBlockHash(1)}getServerInfo(){return this.send("GET_SERVER_INFO")}getBlockHash(t){return this.send("GET_BLOCK",{hashOrNumber:t})}estimateFee(t){return this.send("ESTIMATE_FEE",t)}getAccountInfo(t){return this.send("GET_ACCOUNT_INFO",t)}getAccountUtxo(t){return this.send("GET_ACCOUNT_UTXO",{descriptor:t})}getAccountBalanceHistory(t){return this.send("GET_BALANCE_HISTORY",t)}getTransaction(t){return this.send("GET_TRANSACTION",{txId:t})}pushTransaction(t){return this.send("PUSH_TRANSACTION",{txData:t})}subscribeBlock(){return this.removeSubscription("block"),this.addSubscription("block",(t=>this.emit("block",t))),this.send("SUBSCRIBE_BLOCK")}subscribeAddresses(t){return this.removeSubscription("notification"),this.addSubscription("notification",(t=>this.emit("notification",t))),this.send("SUBSCRIBE_ADDRESS",{addresses:t})}unsubscribeBlock(){return this.removeSubscription("block")>=0?this.send("UNSUBSCRIBE_BLOCK"):{subscribed:!1}}unsubscribeAddresses(){return this.removeSubscription("notification")>=0?this.send("UNSUBSCRIBE_ADDRESS"):{subscribed:!1}}}e.BlockfrostAPI=o},"../blockchain-link/lib/workers/state.js":(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkerState=void 0;const n=r("../blockchain-link-types/lib/constants/errors.js");e.WorkerState=class{constructor(){this.addresses=[],this.accounts=[],this.subscription={}}validateAddresses(t){if(!Array.isArray(t))throw new n.CustomError("invalid_param","+addresses");const e=[];return t.filter((t=>"string"==typeof t&&(!(e.indexOf(t)>=0)&&(e.push(t),!0))))}addAddresses(t){const e=this.validateAddresses(t).filter((t=>this.addresses.indexOf(t)<0));return this.addresses=this.addresses.concat(e),e}getAddresses(){return this.addresses}removeAddresses(t){const e=this.validateAddresses(t);return this.addresses=this.addresses.filter((t=>e.indexOf(t)<0)),this.addresses}validateAccounts(t){if(!Array.isArray(t))throw new n.CustomError("invalid_param","+accounts");const e=[];return t.filter((t=>!(!t||"object"!=typeof t||"string"!=typeof t.descriptor)&&(!(e.indexOf(t.descriptor)>=0)&&(e.push(t.descriptor),!0))))}getAccountAddresses(t){if(t.addresses){const{change:e,used:r,unused:n}=t.addresses;return e.concat(r,n).map((t=>t.address))}return[t.descriptor]}addAccounts(t){const e=this.validateAccounts(t),r=this.accounts.filter((t=>!e.find((e=>e.descriptor===t.descriptor))));this.accounts=r.concat(e);const n=this.accounts.reduce(((t,e)=>t.concat(this.getAccountAddresses(e))),[]);return this.addAddresses(n),e}getAccount(t){return this.accounts.find((e=>{if(e.descriptor===t)return!0;if(e.addresses){const{change:r,used:n,unused:i}=e.addresses;if(r.find((e=>e.address===t)))return!0;if(n.find((e=>e.address===t)))return!0;if(i.find((e=>e.address===t)))return!0}return!1}))}getAccounts(){return this.accounts}removeAccounts(t){const e=this.validateAccounts(t),r=this.accounts.filter((t=>e.find((e=>e.descriptor===t.descriptor)))),n=r.reduce(((t,e)=>t.concat(this.getAccountAddresses(e))),[]);return this.accounts=this.accounts.filter((t=>r.indexOf(t)<0)),this.removeAddresses(n),this.accounts}addSubscription(t){this.subscription[t]=!0}getSubscription(t){return this.subscription[t]}hasSubscriptions(){return Object.keys(this.subscription).length>0}removeSubscription(t){delete this.subscription[t]}clearSubscriptions(){Object.keys(this.subscription).forEach((t=>{delete this.subscription[t]}))}removeEmpty(t){return Object.keys(t).forEach((e=>{Array.isArray(t[e])&&t[e].map((t=>this.removeEmpty(t))),t[e]&&"object"==typeof t[e]?this.removeEmpty(t[e]):void 0===t[e]&&delete t[e]})),t}cleanup(){this.removeAccounts(this.getAccounts()),this.removeAddresses(this.getAddresses()),this.clearSubscriptions()}}},"../blockchain-link/lib/workers/utils.js":(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.prioritizeEndpoints=void 0;const n=r("../utils/lib/index.js");e.prioritizeEndpoints=t=>t.map((t=>{const e=(0,n.parseHostname)(t);let r=Math.random();return"localhost"===e||"127.0.0.1"===e?r+=2:(null==e?void 0:e.endsWith(".onion"))&&(r+=1),[t,r]})).sort((([,t],[,e])=>e-t)).map((([t])=>t))},"../utils/lib/arrayDistinct.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayDistinct=void 0;e.arrayDistinct=(t,e,r)=>r.indexOf(t)===e},"../utils/lib/arrayPartition.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayPartition=void 0;e.arrayPartition=(t,e)=>t.reduce((([t,r],n)=>e(n)?[[...t,n],r]:[t,[...r,n]]),[[],[]])},"../utils/lib/arrayShuffle.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayShuffle=void 0;e.arrayShuffle=t=>{const e=t.slice();for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}return e}},"../utils/lib/arrayToDictionary.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayToDictionary=void 0;const r=t=>!!["string","number"].includes(typeof t);e.arrayToDictionary=(t,e,n)=>n?t.reduce(((t,n)=>{var i;const s=e(n);return r(s)?Object.assign(Object.assign({},t),{[s]:[...null!==(i=t[s])&&void 0!==i?i:[],n]}):t}),{}):t.reduce(((t,n)=>{const i=e(n);return r(i)?Object.assign(Object.assign({},t),{[i]:n}):t}),{})},"../utils/lib/bufferUtils.js":(t,e,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").lW;Object.defineProperty(e,"__esModule",{value:!0}),e.getChunkSize=e.reverseBuffer=void 0;e.reverseBuffer=t=>{if(t.length<1)return t;const e=Buffer.alloc(t.length);let r=e.length-1;for(let n=0;n{const e=Buffer.allocUnsafe(1);return e.writeUInt8(t),e}},"../utils/lib/bytesToHumanReadable.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bytesToHumanReadable=void 0;const r=["B","KB","MB","GB","TB"];e.bytesToHumanReadable=t=>{let e=Math.abs(t),n=0;for(;e>=1024||n>=r.length;)e/=1024,n++;return`${e.toFixed(1)} ${r[n]}`}},"../utils/lib/capitalizeFirstLetter.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.capitalizeFirstLetter=void 0;e.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1)},"../utils/lib/cloneObject.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cloneObject=void 0;e.cloneObject=t=>{const e=JSON.stringify(t);return void 0===e?t:JSON.parse(e)}},"../utils/lib/countBytesInString.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.countBytesInString=void 0;e.countBytesInString=t=>encodeURI(t).split(/%..|./).length-1},"../utils/lib/createCooldown.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createCooldown=void 0;e.createCooldown=t=>{let e=0;return()=>{const r=Date.now();return r-e>=t&&(e=r,!0)}}},"../utils/lib/createDeferred.js":(t,e,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(e,"__esModule",{value:!0}),e.createDeferred=void 0;e.createDeferred=t=>{let e=()=>{},r=()=>{};const i=new n(((t,n)=>{e=t,r=n}));return{id:t,resolve:e,reject:r,promise:i}}},"../utils/lib/createTimeoutPromise.js":(t,e,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(e,"__esModule",{value:!0}),e.createTimeoutPromise=void 0;e.createTimeoutPromise=t=>new n((e=>setTimeout(e,t)))},"../utils/lib/enumUtils.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getValueByKey=e.getKeyByValue=void 0,e.getKeyByValue=function(t,e){return t&&Object.keys(t).find((r=>t[r]===e))},e.getValueByKey=function(t,e){const r=t&&Object.keys(t).find((t=>t===e));return r&&t[r]}},"../utils/lib/getLocaleSeparators.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLocaleSeparators=void 0;e.getLocaleSeparators=t=>{var e,r;const n=new Intl.NumberFormat(t).formatToParts(10000.1);return{decimalSeparator:null===(e=n.find((({type:t})=>"decimal"===t)))||void 0===e?void 0:e.value,thousandsSeparator:null===(r=n.find((({type:t})=>"group"===t)))||void 0===r?void 0:r.value}}},"../utils/lib/getNumberFromPixelString.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getNumberFromPixelString=void 0;e.getNumberFromPixelString=t=>parseInt(t.replace("px",""),10)},"../utils/lib/getRandomNumberInRange.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRandomNumberInRange=void 0;e.getRandomNumberInRange=(t,e)=>Math.floor(Math.random()*(e-t+1))+t},"../utils/lib/getSynchronize.js":(t,e,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(e,"__esModule",{value:!0}),e.getSynchronize=void 0;e.getSynchronize=()=>{let t;return e=>{const r=(null!=t?t:n.resolve()).catch((()=>{})).then(e).finally((()=>{t===r&&(t=void 0)}));return t=r,t}}},"../utils/lib/getWeakRandomId.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getWeakRandomId=void 0;e.getWeakRandomId=t=>{let e="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasUppercaseLetter=void 0;const r=new RegExp("^(.*[A-Z].*)$");e.hasUppercaseLetter=t=>r.test(t)},"../utils/lib/index.js":function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)},o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.xssFilters=e.versionUtils=e.enumUtils=e.bufferUtils=void 0,s(r("../utils/lib/arrayDistinct.js"),e),s(r("../utils/lib/arrayPartition.js"),e),s(r("../utils/lib/arrayShuffle.js"),e),s(r("../utils/lib/arrayToDictionary.js"),e),e.bufferUtils=o(r("../utils/lib/bufferUtils.js")),s(r("../utils/lib/bytesToHumanReadable.js"),e),s(r("../utils/lib/capitalizeFirstLetter.js"),e),s(r("../utils/lib/cloneObject.js"),e),s(r("../utils/lib/countBytesInString.js"),e),s(r("../utils/lib/createCooldown.js"),e),s(r("../utils/lib/createDeferred.js"),e),s(r("../utils/lib/createTimeoutPromise.js"),e),e.enumUtils=o(r("../utils/lib/enumUtils.js")),s(r("../utils/lib/getNumberFromPixelString.js"),e),s(r("../utils/lib/getRandomNumberInRange.js"),e),s(r("../utils/lib/getSynchronize.js"),e),s(r("../utils/lib/getWeakRandomId.js"),e),s(r("../utils/lib/hasUppercaseLetter.js"),e),s(r("../utils/lib/isAscii.js"),e),s(r("../utils/lib/isHex.js"),e),s(r("../utils/lib/isNotUndefined.js"),e),s(r("../utils/lib/isUrl.js"),e),s(r("../utils/lib/mergeDeepObject.js"),e),s(r("../utils/lib/objectPartition.js"),e),s(r("../utils/lib/parseElectrumUrl.js"),e),s(r("../utils/lib/parseHostname.js"),e),s(r("../utils/lib/promiseAllSequence.js"),e),s(r("../utils/lib/redactUserPath.js"),e),s(r("../utils/lib/scheduleAction.js"),e),s(r("../utils/lib/throwError.js"),e),s(r("../utils/lib/truncateMiddle.js"),e),s(r("../utils/lib/topologicalSort.js"),e),s(r("../utils/lib/urlToOnion.js"),e),e.versionUtils=o(r("../utils/lib/versionUtils.js")),e.xssFilters=o(r("../utils/lib/xssFilters.js")),s(r("../utils/lib/getLocaleSeparators.js"),e)},"../utils/lib/isAscii.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAscii=void 0,e.isAscii=function(t){return!t||/^[\x00-\x7F]*$/.test(t)}},"../utils/lib/isHex.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isHex=void 0;e.isHex=t=>/^(0x|0X)?[0-9A-Fa-f]+$/g.test(t)},"../utils/lib/isNotUndefined.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isNotUndefined=void 0;e.isNotUndefined=t=>void 0!==t},"../utils/lib/isUrl.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isUrl=void 0;const r=/^(http|ws)s?:\/\/[a-z0-9]([a-z0-9.-]+)?(:[0-9]{1,5})?((\/)?(([a-z0-9-_])+(\/)?)+)$/i;e.isUrl=t=>r.test(t)},"../utils/lib/mergeDeepObject.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mergeDeepObject=void 0;const r=t=>{if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}return"[object Object]"===Object.prototype.toString.call(t)}return!1};e.mergeDeepObject=(...t)=>t.reduce(((t,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach((i=>{["__proto__","constructor","prototype"].includes(i)||(Array.isArray(t[i])&&Array.isArray(n[i])?t[i]=e.mergeDeepObject.options.mergeArrays?Array.from(new Set(t[i].concat(n[i]))):n[i]:r(t[i])&&r(n[i])?t[i]=(0,e.mergeDeepObject)(t[i],n[i]):t[i]=n[i])})),t}),{});const n={mergeArrays:!0};e.mergeDeepObject.options=n,e.mergeDeepObject.withOptions=(t,...r)=>{e.mergeDeepObject.options=Object.assign({mergeArrays:!0},t);const i=(0,e.mergeDeepObject)(...r);return e.mergeDeepObject.options=n,i}},"../utils/lib/objectPartition.js":function(t,e){"use strict";var r=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);ie.reduce((([t,e],n)=>{const i=e,s=n,o=i[s],u=r(i,["symbol"==typeof s?s:s+""]);return void 0!==o?[Object.assign(Object.assign({},t),{[n]:o}),u]:[t,e]}),[{},t])},"../utils/lib/parseElectrumUrl.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseElectrumUrl=void 0;const r=/^(?:([a-zA-Z0-9.-]+)|\[([a-f0-9:]+)\]):([0-9]{1,5}):([ts])$/;e.parseElectrumUrl=t=>{var e;const n=t.match(r);if(n)return{host:null!==(e=n[1])&&void 0!==e?e:n[2],port:Number.parseInt(n[3],10),protocol:n[4]}}},"../utils/lib/parseHostname.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseHostname=void 0;const r=/^([a-z0-9.+-]+:\/\/)?([a-z0-9.-]+)([:/][^:/]+)*\/?$/i;e.parseHostname=t=>{var e,n;return null===(n=null===(e=t.match(r))||void 0===e?void 0:e[2])||void 0===n?void 0:n.toLowerCase()}},"../utils/lib/promiseAllSequence.js":function(t,e,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=n))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function u(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,u)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.promiseAllSequence=void 0;e.promiseAllSequence=t=>i(void 0,void 0,void 0,(function*(){const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.redactUserPathFromString=e.startOfUserPathRegex=void 0,e.startOfUserPathRegex=/([/\\][Uu]sers[/\\]{1,4})([^"^'^[^\]^/^\\]*)/g;e.redactUserPathFromString=t=>t.replace(e.startOfUserPathRegex,"$1[*]")},"../utils/lib/scheduleAction.js":function(t,e,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=n))((function(n,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function u(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,u)}c((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleAction=void 0;const s=t=>Array.isArray(t),o=()=>new Error("Aborted by signal"),u=()=>new Error("Aborted by deadline"),c=()=>new Error("Aborted by timeout"),a=(t,e)=>new n(((r,n)=>{if(e.aborted)return n();if(void 0===t)return r();const i=setTimeout(r,t),s=()=>{clearTimeout(i),e.removeEventListener("abort",s),n()};e.addEventListener("abort",s)})),l=(t,e,r)=>new n(((n,i)=>{if(r.aborted)return i();const s=void 0!==t?setTimeout((()=>i(e())),t):void 0,o=()=>{clearTimeout(s),r.removeEventListener("abort",o),i()};r.addEventListener("abort",o)})),f=(t,e)=>new n(((r,n)=>{if(e.aborted)return n();if(null==t?void 0:t.aborted)return n(o());const i=()=>n(o());null==t||t.addEventListener("abort",i);const s=()=>{null==t||t.removeEventListener("abort",i),e.removeEventListener("abort",s),n()};e.addEventListener("abort",s)})),h=(t,e)=>i(void 0,void 0,void 0,(function*(){const r=new AbortController,i=()=>r.abort();e.aborted&&i(),e.addEventListener("abort",i);try{return yield new n((e=>e(t(r.signal))))}finally{e.removeEventListener("abort",i)}}));e.scheduleAction=(t,e)=>i(void 0,void 0,void 0,(function*(){const{signal:r,delay:o,attempts:d,timeout:p,deadline:g,gap:y}=e,b=g&&g-Date.now(),m=s(d)?d.length:null!=d?d:g?1/0:1,v=new AbortController,_=v.signal,w=s(d)?t=>d[t]:()=>({timeout:p,gap:y});try{return yield n.race([f(r,_),l(b,u,_),a(o,_).then((()=>((t,e,r,s)=>i(void 0,void 0,void 0,(function*(){for(let n=0;nt.abort();s.addEventListener("abort",i);try{return yield e(n,t.signal)}catch(t){i(),yield r(n)}finally{s.removeEventListener("abort",i)}}return s.aborted?n.reject():e(t-1,s)})))(m,((e,r)=>n.race([l(w(e).timeout,c,_),h(t,r)])),(t=>{var e;return a(null!==(e=w(t).gap)&&void 0!==e?e:0,_)}),_)))])}finally{v.abort()}}))},"../utils/lib/throwError.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=void 0;e.throwError=t=>{throw new Error(t)}},"../utils/lib/topologicalSort.js":(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.topologicalSort=void 0;const n=r("../utils/lib/arrayPartition.js");e.topologicalSort=(t,e,r)=>{const i=[],s=t=>(0,n.arrayPartition)(t,(r=>!t.some((t=>e(t,r)))));let o=t;for(;o.length;){const[t,e]=s(o);if(!t.length)throw new Error("Cycle detected");i.push(...r?t.sort(r):t),o=e}return i}},"../utils/lib/truncateMiddle.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.truncateMiddle=void 0;e.truncateMiddle=(t,e,r)=>{if(t.length<=e+r)return t;return`${t.substring(0,e)}…${t.substring(t.length-r,t.length)}`}},"../utils/lib/typedEventEmitter.js":(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEmitter=void 0;const n=r("../../node_modules/events/events.js");class i extends n.EventEmitter{listenerCount(t){return super.listenerCount(t)}}e.TypedEmitter=i},"../utils/lib/urlToOnion.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.urlToOnion=void 0;e.urlToOnion=(t,e)=>{var r;const[,n,i,s,o]=null!==(r=t.match(/^(http|ws)s?:\/\/([^:/]+\.)?([^/.]+\.[^/.]+)(\/.*)?$/i))&&void 0!==r?r:[];if(s&&e[s])return`${n}://${null!=i?i:""}${e[s]}${null!=o?o:""}`}},"../utils/lib/versionUtils.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeVersion=e.isNewerOrEqual=e.isEqual=e.isNewer=e.isVersionArray=void 0;e.isVersionArray=t=>{if(!Array.isArray(t))return!1;if(3!==t.length)return!1;for(let e=0;e({major:t[0],minor:t[1],patch:t[2]}),n=t=>{const r=t.split(".").map((t=>Number(t)));if(!(0,e.isVersionArray)(r))throw new Error("version string is in wrong format");return r},i=t=>`${t[0]}.${t[1]}.${t[2]}`;e.isNewer=(t,e)=>{const i=r("string"==typeof t?n(t):t),s=r("string"==typeof e?n(e):e);return i.major-s.major!=0?i.major>s.major:i.minor-s.minor!=0?i.minor>s.minor:i.patch-s.patch!=0&&i.patch>s.patch};e.isEqual=(t,e)=>("string"==typeof t?t:i(t))===("string"==typeof e?e:i(e));e.isNewerOrEqual=(t,r)=>(0,e.isNewer)(t,r)||(0,e.isEqual)(t,r);e.normalizeVersion=t=>t.replace(/\b0+(\d)/g,"$1")},"../utils/lib/xssFilters.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inDoubleQuotes=e.inSingleQuotes=e.inHTML=void 0;const r=/t.replace(r,"<");e.inSingleQuotes=t=>t.replace(n,"'");e.inDoubleQuotes=t=>t.replace(i,""")},"../../node_modules/base64-js/index.js":(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,s=u(t),o=s[0],c=s[1],a=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,c)),l=0,f=c>0?o-4:o;for(r=0;r>16&255,a[l++]=e>>8&255,a[l++]=255&e;2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,a[l++]=255&e);1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,a[l++]=e>>8&255,a[l++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,s=[],o=16383,u=0,a=n-i;ua?a:u+o));1===i?(e=t[n-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function u(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("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,s,o=[],u=e;u>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},"../../node_modules/bignumber.js/bignumber.js":function(t,e,r){var n;!function(i){"use strict";var s,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,u=Math.ceil,c=Math.floor,a="[BigNumber Error] ",l=a+"Number primitive has more than 15 significant digits: ",f=1e14,h=14,d=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,y=1e9;function b(t){var e=0|t;return t>0||t===e?e:e-1}function m(t){for(var e,r,n=1,i=t.length,s=t[0]+"";na^r?1:-1;for(u=(c=i.length)<(a=s.length)?c:a,o=0;os[o]^r?1:-1;return c==a?0:c>a^r?1:-1}function _(t,e,r,n){if(tr||t!==c(t))throw Error(a+(n||"Argument")+("number"==typeof t?tr?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function w(t){var e=t.c.length-1;return b(t.e/h)==e&&t.c[e]%2!=0}function E(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function A(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(++e>(n=t.length)){for(i=r,e-=n;--e;i+=r);t+=i}else eL?b.c=b.e=null:t.e=10;f/=10,a++);return void(a>L?b.c=b.e=null:(b.e=a,b.c=[t]))}y=String(t)}else{if(!o.test(y=String(t)))return i(b,y,p);b.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(a=y.indexOf("."))>-1&&(y=y.replace(".","")),(f=y.search(/e/i))>0?(a<0&&(a=f),a+=+y.slice(f+1),y=y.substring(0,f)):a<0&&(a=y.length)}else{if(_(e,2,H.length,"Base"),10==e&&$)return q(b=new V(t),B+b.e+1,R);if(y=String(t),p="number"==typeof t){if(0*t!=0)return i(b,y,p,e);if(b.s=1/t<0?(y=y.slice(1),-1):1,V.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(l+t)}else b.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(r=H.slice(0,e),a=f=0,g=y.length;fa){a=g;continue}}else if(!u&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){u=!0,f=-1,a=0;continue}return i(b,String(t),p,e)}p=!1,(a=(y=n(y,e,10,b.s)).indexOf("."))>-1?y=y.replace(".",""):a=y.length}for(f=0;48===y.charCodeAt(f);f++);for(g=y.length;48===y.charCodeAt(--g););if(y=y.slice(f,++g)){if(g-=f,p&&V.DEBUG&&g>15&&(t>d||t!==c(t)))throw Error(l+b.s*t);if((a=a-f-1)>L)b.c=b.e=null;else if(a=P)?E(c,o):A(c,o,"0");else if(s=(t=q(new V(t),e,r)).e,u=(c=m(t.c)).length,1==n||2==n&&(e<=s||s<=U)){for(;uu){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=s-u)>0)for(s+1==u&&(c+=".");e--;c+="0");return t.s<0&&i?"-"+c:c}function z(t,e){for(var r,n=1,i=new V(t[0]);n=10;i/=10,n++);return(r=n+r*h-1)>L?t.c=t.e=null:r=10;a/=10,i++);if((s=e-i)<0)s+=h,o=e,g=(l=y[d=0])/b[i-o-1]%10|0;else if((d=u((s+1)/h))>=y.length){if(!n)break t;for(;y.length<=d;y.push(0));l=g=0,i=1,o=(s%=h)-h+1}else{for(l=a=y[d],i=1;a>=10;a/=10,i++);g=(o=(s%=h)-h+i)<0?0:l/b[i-o-1]%10|0}if(n=n||e<0||null!=y[d+1]||(o<0?l:l%b[i-o-1]),n=r<4?(g||n)&&(0==r||r==(t.s<0?3:2)):g>5||5==g&&(4==r||n||6==r&&(s>0?o>0?l/b[i-o]:0:y[d-1])%10&1||r==(t.s<0?8:7)),e<1||!y[0])return y.length=0,n?(e-=t.e+1,y[0]=b[(h-e%h)%h],t.e=-e||0):y[0]=t.e=0,t;if(0==s?(y.length=d,a=1,d--):(y.length=d+1,a=b[h-s],y[d]=o>0?c(l/b[i-o]%b[o])*a:0),n)for(;;){if(0==d){for(s=1,o=y[0];o>=10;o/=10,s++);for(o=y[0]+=a,a=1;o>=10;o/=10,a++);s!=a&&(t.e++,y[0]==f&&(y[0]=1));break}if(y[d]+=a,y[d]!=f)break;y[d--]=0,a=1}for(s=y.length;0===y[--s];y.pop());}t.e>L?t.c=t.e=null:t.e=P?E(e,r):A(e,r,"0"),t.s<0?"-"+e:e)}return V.clone=t,V.ROUND_UP=0,V.ROUND_DOWN=1,V.ROUND_CEIL=2,V.ROUND_FLOOR=3,V.ROUND_HALF_UP=4,V.ROUND_HALF_DOWN=5,V.ROUND_HALF_EVEN=6,V.ROUND_HALF_CEIL=7,V.ROUND_HALF_FLOOR=8,V.EUCLID=9,V.config=V.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(a+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(_(r=t[e],0,y,e),B=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(_(r=t[e],0,8,e),R=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(_(r[0],-y,0,e),_(r[1],0,y,e),U=r[0],P=r[1]):(_(r,-y,y,e),U=-(P=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)_(r[0],-y,-1,e),_(r[1],1,y,e),x=r[0],L=r[1];else{if(_(r,-y,y,e),!r)throw Error(a+e+" cannot be zero: "+r);x=-(L=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(a+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw M=!r,Error(a+"crypto unavailable");M=r}else M=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(_(r=t[e],0,9,e),D=r),t.hasOwnProperty(e="POW_PRECISION")&&(_(r=t[e],0,y,e),F=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(a+e+" not an object: "+r);G=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(a+e+" invalid: "+r);$="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:B,ROUNDING_MODE:R,EXPONENTIAL_AT:[U,P],RANGE:[x,L],CRYPTO:M,MODULO_MODE:D,POW_PRECISION:F,FORMAT:G,ALPHABET:H}},V.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!V.DEBUG)return!0;var e,r,n=t.c,i=t.e,s=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===s||-1===s)&&i>=-y&&i<=y&&i===c(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break t}if((e=(i+1)%h)<1&&(e+=h),String(n[0]).length==e){for(e=0;e=f||r!==c(r))break t;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===s||1===s||-1===s))return!0;throw Error(a+"Invalid BigNumber: "+t)},V.maximum=V.max=function(){return z(arguments,C.lt)},V.minimum=V.min=function(){return z(arguments,C.gt)},V.random=(s=9007199254740992,O=Math.random()*s&2097151?function(){return c(Math.random()*s)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,i,s,o=0,l=[],f=new V(k);if(null==t?t=B:_(t,0,y),i=u(t/h),M)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));o>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[o]=r[0],e[o+1]=r[1]):(l.push(s%1e14),o+=2);o=i/2}else{if(!crypto.randomBytes)throw M=!1,Error(a+"crypto unavailable");for(e=crypto.randomBytes(i*=7);o=9e15?crypto.randomBytes(7).copy(e,o):(l.push(s%1e14),o+=7);o=i/7}if(!M)for(;o=10;s/=10,o++);or-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(n,i,s,o,u){var c,a,l,f,h,d,p,g,y=n.indexOf("."),b=B,v=R;for(y>=0&&(f=F,F=0,n=n.replace(".",""),d=(g=new V(i)).pow(n.length-y),F=f,g.c=e(A(m(d.c),d.e,"0"),10,s,t),g.e=g.c.length),l=f=(p=e(n,i,s,u?(c=H,t):(c=t,H))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(y<0?--l:(d.c=p,d.e=l,d.s=o,p=(d=r(d,g,b,v,s)).c,h=d.r,l=d.e),y=p[a=l+b+1],f=s/2,h=h||a<0||null!=p[a+1],h=v<4?(null!=y||h)&&(0==v||v==(d.s<0?3:2)):y>f||y==f&&(4==v||h||6==v&&1&p[a-1]||v==(d.s<0?8:7)),a<1||!p[0])n=h?A(c.charAt(1),-b,c.charAt(0)):c.charAt(0);else{if(p.length=a,h)for(--s;++p[--a]>s;)p[a]=0,a||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(y=0,n="";y<=f;n+=c.charAt(p[y++]));n=A(n,l,c.charAt(0))}return n}}(),r=function(){function t(t,e,r){var n,i,s,o,u=0,c=t.length,a=e%g,l=e/g|0;for(t=t.slice();c--;)u=((i=a*(s=t[c]%g)+(n=l*s+(o=t[c]/g|0)*a)%g*g+u)/r|0)+(n/g|0)+l*o,t[c]=i%r;return u&&(t=[u].concat(t)),t}function e(t,e,r,n){var i,s;if(r!=n)s=r>n?1:-1;else for(i=s=0;ie[i]?1:-1;break}return s}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]1;t.splice(0,1));}return function(n,i,s,o,u){var a,l,d,p,g,y,m,v,_,w,E,A,O,T,S,j,N,I=n.s==i.s?1:-1,C=n.c,k=i.c;if(!(C&&C[0]&&k&&k[0]))return new V(n.s&&i.s&&(C?!k||C[0]!=k[0]:k)?C&&0==C[0]||!k?0*I:I/0:NaN);for(_=(v=new V(I)).c=[],I=s+(l=n.e-i.e)+1,u||(u=f,l=b(n.e/h)-b(i.e/h),I=I/h|0),d=0;k[d]==(C[d]||0);d++);if(k[d]>(C[d]||0)&&l--,I<0)_.push(1),p=!0;else{for(T=C.length,j=k.length,d=0,I+=2,(g=c(u/(k[0]+1)))>1&&(k=t(k,g,u),C=t(C,g,u),j=k.length,T=C.length),O=j,E=(w=C.slice(0,j)).length;E=u/2&&S++;do{if(g=0,(a=e(k,w,j,E))<0){if(A=w[0],j!=E&&(A=A*u+(w[1]||0)),(g=c(A/S))>1)for(g>=u&&(g=u-1),m=(y=t(k,g,u)).length,E=w.length;1==e(y,w,m,E);)g--,r(y,j=10;I/=10,d++);q(v,s+(v.e=d+l*h-1)+1,o,p)}else v.e=l,v.r=+p;return v}}(),T=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,j=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,r,n){var i,s=r?e:e.replace(I,"");if(N.test(s))t.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(T,(function(t,e,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?t:e})),n&&(i=n,s=s.replace(S,"$1").replace(j,"0.$1")),e!=s))return new V(s,i);if(V.DEBUG)throw Error(a+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},C.absoluteValue=C.abs=function(){var t=new V(this);return t.s<0&&(t.s=1),t},C.comparedTo=function(t,e){return v(this,new V(t,e))},C.decimalPlaces=C.dp=function(t,e){var r,n,i,s=this;if(null!=t)return _(t,0,y),null==e?e=R:_(e,0,8),q(new V(s),t+s.e+1,e);if(!(r=s.c))return null;if(n=((i=r.length-1)-b(this.e/h))*h,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},C.dividedBy=C.div=function(t,e){return r(this,new V(t,e),B,R)},C.dividedToIntegerBy=C.idiv=function(t,e){return r(this,new V(t,e),0,1)},C.exponentiatedBy=C.pow=function(t,e){var r,n,i,s,o,l,f,d,p=this;if((t=new V(t)).c&&!t.isInteger())throw Error(a+"Exponent not an integer: "+Y(t));if(null!=e&&(e=new V(e)),o=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return d=new V(Math.pow(+Y(p),o?t.s*(2-w(t)):+Y(t))),e?d.mod(e):d;if(l=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new V(NaN);(n=!l&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||o&&p.c[1]>=24e7:p.c[0]<8e13||o&&p.c[0]<=9999975e7)))return s=p.s<0&&w(t)?-0:0,p.e>-1&&(s=1/s),new V(l?1/s:s);F&&(s=u(F/h+2))}for(o?(r=new V(.5),l&&(t.s=1),f=w(t)):f=(i=Math.abs(+Y(t)))%2,d=new V(k);;){if(f){if(!(d=d.times(p)).c)break;s?d.c.length>s&&(d.c.length=s):n&&(d=d.mod(e))}if(i){if(0===(i=c(i/2)))break;f=i%2}else if(q(t=t.times(r),t.e+1,1),t.e>14)f=w(t);else{if(0===(i=+Y(t)))break;f=i%2}p=p.times(p),s?p.c&&p.c.length>s&&(p.c.length=s):n&&(p=p.mod(e))}return n?d:(l&&(d=k.div(d)),e?d.mod(e):s?q(d,F,R,undefined):d)},C.integerValue=function(t){var e=new V(this);return null==t?t=R:_(t,0,8),q(e,e.e+1,t)},C.isEqualTo=C.eq=function(t,e){return 0===v(this,new V(t,e))},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(t,e){return v(this,new V(t,e))>0},C.isGreaterThanOrEqualTo=C.gte=function(t,e){return 1===(e=v(this,new V(t,e)))||0===e},C.isInteger=function(){return!!this.c&&b(this.e/h)>this.c.length-2},C.isLessThan=C.lt=function(t,e){return v(this,new V(t,e))<0},C.isLessThanOrEqualTo=C.lte=function(t,e){return-1===(e=v(this,new V(t,e)))||0===e},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.minus=function(t,e){var r,n,i,s,o=this,u=o.s;if(e=(t=new V(t,e)).s,!u||!e)return new V(NaN);if(u!=e)return t.s=-e,o.plus(t);var c=o.e/h,a=t.e/h,l=o.c,d=t.c;if(!c||!a){if(!l||!d)return l?(t.s=-e,t):new V(d?o:NaN);if(!l[0]||!d[0])return d[0]?(t.s=-e,t):new V(l[0]?o:3==R?-0:0)}if(c=b(c),a=b(a),l=l.slice(),u=c-a){for((s=u<0)?(u=-u,i=l):(a=c,i=d),i.reverse(),e=u;e--;i.push(0));i.reverse()}else for(n=(s=(u=l.length)<(e=d.length))?u:e,u=e=0;e0)for(;e--;l[r++]=0);for(e=f-1;n>u;){if(l[--n]=0;){for(r=0,p=A[i]%_,y=A[i]/_|0,s=i+(o=c);s>i;)r=((a=p*(a=E[--o]%_)+(u=y*a+(l=E[o]/_|0)*p)%_*_+m[s]+r)/v|0)+(u/_|0)+y*l,m[s--]=a%v;m[s]=r}return r?++n:m.splice(0,1),K(t,m,n)},C.negated=function(){var t=new V(this);return t.s=-t.s||null,t},C.plus=function(t,e){var r,n=this,i=n.s;if(e=(t=new V(t,e)).s,!i||!e)return new V(NaN);if(i!=e)return t.s=-e,n.minus(t);var s=n.e/h,o=t.e/h,u=n.c,c=t.c;if(!s||!o){if(!u||!c)return new V(i/0);if(!u[0]||!c[0])return c[0]?t:new V(u[0]?n:0*i)}if(s=b(s),o=b(o),u=u.slice(),i=s-o){for(i>0?(o=s,r=c):(i=-i,r=u),r.reverse();i--;r.push(0));r.reverse()}for((i=u.length)-(e=c.length)<0&&(r=c,c=u,u=r,e=i),i=0;e;)i=(u[--e]=u[e]+c[e]+i)/f|0,u[e]=f===u[e]?0:u[e]%f;return i&&(u=[i].concat(u),++o),K(t,u,o)},C.precision=C.sd=function(t,e){var r,n,i,s=this;if(null!=t&&t!==!!t)return _(t,1,y),null==e?e=R:_(e,0,8),q(new V(s),t,e);if(!(r=s.c))return null;if(n=(i=r.length-1)*h+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return t&&s.e+1>n&&(n=s.e+1),n},C.shiftedBy=function(t){return _(t,-9007199254740991,d),this.times("1e"+t)},C.squareRoot=C.sqrt=function(){var t,e,n,i,s,o=this,u=o.c,c=o.s,a=o.e,l=B+4,f=new V("0.5");if(1!==c||!u||!u[0])return new V(!c||c<0&&(!u||u[0])?NaN:u?o:1/0);if(0==(c=Math.sqrt(+Y(o)))||c==1/0?(((e=m(u)).length+a)%2==0&&(e+="0"),c=Math.sqrt(+e),a=b((a+1)/2)-(a<0||a%2),n=new V(e=c==1/0?"5e"+a:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+a)):n=new V(c+""),n.c[0])for((c=(a=n.e)+l)<3&&(c=0);;)if(s=n,n=f.times(s.plus(r(o,s,l,1))),m(s.c).slice(0,c)===(e=m(n.c)).slice(0,c)){if(n.e0&&g>0){for(s=g%u||u,f=p.substr(0,s);s0&&(f+=l+p.slice(s)),d&&(f="-"+f)}n=h?f+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):f}return(r.prefix||"")+n+(r.suffix||"")},C.toFraction=function(t){var e,n,i,s,o,u,c,l,f,d,g,y,b=this,v=b.c;if(null!=t&&(!(c=new V(t)).isInteger()&&(c.c||1!==c.s)||c.lt(k)))throw Error(a+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+Y(c));if(!v)return new V(b);for(e=new V(k),f=n=new V(k),i=l=new V(k),y=m(v),o=e.e=y.length-b.e-1,e.c[0]=p[(u=o%h)<0?h+u:u],t=!t||c.comparedTo(e)>0?o>0?e:f:c,u=L,L=1/0,c=new V(y),l.c[0]=0;d=r(c,e,0,1),1!=(s=n.plus(d.times(i))).comparedTo(t);)n=i,i=s,f=l.plus(d.times(s=f)),l=s,e=c.minus(d.times(s=e)),c=s;return s=r(t.minus(n),i,0,1),l=l.plus(s.times(f)),n=n.plus(s.times(i)),l.s=f.s=b.s,g=r(f,i,o*=2,R).minus(b).abs().comparedTo(r(l,n,o,R).minus(b).abs())<1?[f,i]:[l,n],L=u,g},C.toNumber=function(){return+Y(this)},C.toPrecision=function(t,e){return null!=t&&_(t,1,y),W(this,t,e,2)},C.toString=function(t){var e,r=this,i=r.s,s=r.e;return null===s?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=s<=U||s>=P?E(m(r.c),s):A(m(r.c),s,"0"):10===t&&$?e=A(m((r=q(new V(r),B+s+1,R)).c),r.e,"0"):(_(t,2,H.length,"Base"),e=n(A(m(r.c),s,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},C.valueOf=C.toJSON=function(){return Y(this)},C._isBigNumber=!0,null!=e&&V.set(e),V}(),s.default=s.BigNumber=s,void 0===(n=function(){return s}.call(e,r,e,t))||(t.exports=n)}()},"../../node_modules/buffer/index.js":(t,e,r)=>{"use strict"; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +const n=r("../../node_modules/base64-js/index.js"),i=r("../../node_modules/ieee754/index.js"),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=Buffer,e.h2=50;const o=2147483647;function u(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,Buffer.prototype),e}function Buffer(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!Buffer.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|p(t,e);let n=u(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(q(t,Uint8Array)){const e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(q(t,ArrayBuffer)||t&&q(t.buffer,ArrayBuffer))return h(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(q(t,SharedArrayBuffer)||t&&q(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return Buffer.from(n,e,r);const i=function(t){if(Buffer.isBuffer(t)){const e=0|d(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||Y(t.length)?u(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return Buffer.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)}function a(t){if("number"!=typeof t)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 l(t){return a(t),u(t<0?0:0|d(t))}function f(t){const e=t.length<0?0:0|d(t.length),r=u(e);for(let n=0;n=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,e){if(Buffer.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||q(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(i)return n?-1:W(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return j(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=Buffer.from(e,n)),Buffer.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){let s,o=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,u/=2,c/=2,r/=2}function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){let n=-1;for(s=r;su&&(r=u-c),s=r;s>=0;s--){let r=!0;for(let n=0;ni&&(n=i):n=i;const s=e.length;let o;for(n>s/2&&(n=s/2),o=0;o>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+o<=r){let r,n,u,c;switch(o){case 1:e<128&&(s=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(s=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:r=t[i+1],n=t[i+2],u=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&u)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&u,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return function(t){const e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(Buffer.isBuffer(e)||(e=Buffer.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!Buffer.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},Buffer.byteLength=p,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},s&&(Buffer.prototype[s]=Buffer.prototype.inspect),Buffer.prototype.compare=function(t,e,r,n,i){if(q(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0);const u=Math.min(s,o),c=this.slice(n,i),a=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return w(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function j(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,s){if(!Buffer.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function R(t,e,r,n,i){G(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,r}function U(t,e,r,n,i){G(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s>>=8,t[r+6]=s,s>>=8,t[r+5]=s,s>>=8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o>>=8,t[r+2]=o,o>>=8,t[r+1]=o,o>>=8,t[r]=o,r+8}function P(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(t,e,r,n,s){return e=+e,r>>>=0,s||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,s){return e=+e,r>>>=0,s||P(t,0,r,8),i.write(t,e,r,n,52,8),r+8}Buffer.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||k(t,e,this.length);let n=this[t],i=1,s=0;for(;++s>>=0,e>>>=0,r||k(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),this[t]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readBigUInt64LE=J((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||k(t,e,this.length);let n=this[t],i=1,s=0;for(;++s=i&&(n-=Math.pow(2,8*e)),n},Buffer.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);let n=e,i=1,s=this[t+--n];for(;n>0&&(i*=256);)s+=this[t+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},Buffer.prototype.readInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Buffer.prototype.readInt16LE=function(t,e){t>>>=0,e||k(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,e){t>>>=0,e||k(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readBigInt64LE=J((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||k(t,4,this.length),i.read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return t>>>=0,e||k(t,4,this.length),i.read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return t>>>=0,e||k(t,8,this.length),i.read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return t>>>=0,e||k(t,8,this.length),i.read(this,t,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){B(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,s=0;for(this[e]=255&t;++s>>=0,r>>>=0,!n){B(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},Buffer.prototype.writeBigUInt64LE=J((function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeBigUInt64BE=J((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);B(this,t,e,r,n-1,-n)}let i=0,s=1,o=0;for(this[e]=255&t;++i>0)-o&255;return e+r},Buffer.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);B(this,t,e,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(t/s>>0)-o&255;return e+r},Buffer.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},Buffer.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},Buffer.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},Buffer.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},Buffer.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},Buffer.prototype.writeBigInt64LE=J((function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeBigInt64BE=J((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeFloatLE=function(t,e,r){return x(this,t,e,!0,r)},Buffer.prototype.writeFloatBE=function(t,e,r){return x(this,t,e,!1,r)},Buffer.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},Buffer.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},Buffer.prototype.copy=function(t,e,r,n){if(!Buffer.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function G(t,e,r,n,i,s){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||$(e,t.length-(r+1))}(n,i,s)}function H(t,e){if("number"!=typeof t)throw new M.ERR_INVALID_ARG_TYPE(e,"number",t)}function $(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function W(t,e){let r;e=e||1/0;const n=t.length;let i=null;const s=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function q(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function J(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},"../../node_modules/es6-promise/dist/es6-promise.js":function(t,e,r){var n=r("../../node_modules/process/browser.js"); +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.8+1e68dce6 + */t.exports=function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},s=0,o=void 0,u=void 0,c=function(t,e){w[s]=t,w[s+1]=e,2===(s+=2)&&(u?u(E):O())};function a(t){u=t}function l(t){c=t}var f="undefined"!=typeof window?window:void 0,h=f||{},d=h.MutationObserver||h.WebKitMutationObserver,p="undefined"==typeof self&&"[object process]"==={}.toString.call(n),g="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function y(){return function(){return n.nextTick(E)}}function b(){return void 0!==o?function(){o(E)}:_()}function m(){var t=0,e=new d(E),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function v(){var t=new MessageChannel;return t.port1.onmessage=E,function(){return t.port2.postMessage(0)}}function _(){var t=setTimeout;return function(){return t(E,1)}}var w=new Array(1e3);function E(){for(var t=0;t{"use strict";var n,i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,s="object"==typeof Reflect?Reflect:null,o=s&&"function"==typeof s.apply?s.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var u=Number.isNaN||function(t){return t!=t};function c(){c.init.call(this)}t.exports=c,t.exports.once=function(t,e){return new i((function(r,n){function i(r){t.removeListener(e,s),n(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}m(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&m(t,"error",e,r)}(t,i,{once:!0})}))},c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var a=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?c.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var i,events,s,o;if(l(r),void 0===(events=t._events)?(events=t._events=Object.create(null),t._eventsCount=0):(void 0!==events.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),events=t._events),s=events[e]),void 0===s)s=events[e]=r,++t._eventsCount;else if("function"==typeof s?s=events[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=f(t))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,o=u,console&&console.warn&&console.warn(o)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function g(t,e,r){var events=t._events;if(void 0===events)return[];var n=events[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(i=e[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var u=events[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,a=b(u,c);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},c.prototype.listeners=function(t){return g(this,t,!0)},c.prototype.rawListeners=function(t){return g(this,t,!1)},c.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):y.call(t,e)},c.prototype.listenerCount=y,c.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},"../../node_modules/ieee754/index.js":(t,e)=>{ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +e.read=function(t,e,r,n,i){var s,o,u=8*i-n-1,c=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,s=d&(1<<-l)-1,d>>=-l,l+=u;l>0;s=256*s+t[e+f],f+=h,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+t[e+f],f+=h,l-=8);if(0===s)s=1-a;else{if(s===c)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=a}return(d?-1:1)*o*Math.pow(2,s-n)},e.write=function(t,e,r,n,i,s){var o,u,c,a=8*s-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(o++,c/=2),o+f>=l?(u=0,o=l):o+f>=1?(u=(e*c-1)*Math.pow(2,i),o+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&u,d+=p,u/=256,i-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,a-=8);t[r+d-p]|=128*g}},"../../node_modules/process/browser.js":t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,c=[],a=!1,l=-1;function f(){a&&u&&(a=!1,u.length?c=u.concat(c):l=-1,c.length&&h())}function h(){if(!a){var t=o(f);a=!0;for(var e=c.length;e;){for(u=c,c=[];++l1)for(var r=1;r{"use strict";const t=r("../blockchain-link-types/lib/constants/errors.js"),e=r("../blockchain-link-types/lib/constants/index.js"),n=r("../blockchain-link/lib/workers/baseWorker.js"),i=r("../blockchain-link/lib/workers/blockfrost/websocket.js"),s=r("../blockchain-link-utils/lib/blockfrost.js"),o=({state:t,post:r},n)=>{const i=n.address,o=t.getAccount(i);r({id:-1,type:e.RESPONSES.NOTIFICATION,payload:{type:"notification",payload:{descriptor:o?o.descriptor:i,tx:o?(0,s.transformTransaction)(o.descriptor,o.addresses,n):(0,s.transformTransaction)(i,void 0,n)}}})},u=async t=>{if(t.state.getSubscription("block"))return{subscribed:!0};const r=await t.connect();return t.state.addSubscription("block"),r.on("block",(r=>(({post:t},r)=>{t({id:-1,type:e.RESPONSES.NOTIFICATION,payload:{type:"block",payload:{blockHeight:r.height||0,blockHash:r.hash}}})})(t,r))),r.subscribeBlock()},c=async r=>{const{payload:n}=r;let i;if("accounts"===n.type)i=await(async(t,e)=>{const r=await t.connect(),{state:n}=t;return n.addAccounts(e),n.getSubscription("notification")||(r.on("notification",(e=>o(t,e))),n.addSubscription("notification")),r.subscribeAddresses(n.getAddresses())})(r,n.accounts);else if("addresses"===n.type)i=await(async(t,e)=>{const r=await t.connect(),{state:n}=t;return n.addAddresses(e),n.getSubscription("notification")||(r.on("notification",(e=>o(t,e))),n.addSubscription("notification")),r.subscribeAddresses(n.getAddresses())})(r,n.addresses);else{if("block"!==n.type)throw new t.CustomError("invalid_param","+type");i=await u(r)}return{type:e.RESPONSES.SUBSCRIBE,payload:i}},a=r=>{switch(r.type){case e.MESSAGES.GET_INFO:return(async t=>{const r=await t.connect(),n=await r.getServerInfo();return{type:e.RESPONSES.GET_INFO,payload:Object.assign({url:r.options.url},n)}})(r);case e.MESSAGES.GET_BLOCK_HASH:return(async t=>{const r=await t.connect(),n=await r.getBlockHash(t.payload);return{type:e.RESPONSES.GET_BLOCK_HASH,payload:n.hash}})(r);case e.MESSAGES.GET_ACCOUNT_BALANCE_HISTORY:return(async t=>{const r=await t.connect(),n=await r.getAccountBalanceHistory(t.payload);return{type:e.RESPONSES.GET_ACCOUNT_BALANCE_HISTORY,payload:n}})(r);case e.MESSAGES.GET_ACCOUNT_INFO:return(async t=>{const r=await t.connect(),n=await r.getAccountInfo(t.payload);return{type:e.RESPONSES.GET_ACCOUNT_INFO,payload:(0,s.transformAccountInfo)(n)}})(r);case e.MESSAGES.GET_ACCOUNT_UTXO:return(async t=>{const r=await t.connect(),n=await r.getAccountUtxo(t.payload);return{type:e.RESPONSES.GET_ACCOUNT_UTXO,payload:(0,s.transformUtxos)(n)}})(r);case e.MESSAGES.GET_TRANSACTION:return(async t=>{const r=await t.connect(),n=await r.getTransaction(t.payload);return{type:e.RESPONSES.GET_TRANSACTION,payload:{type:"blockfrost",tx:n}}})(r);case e.MESSAGES.ESTIMATE_FEE:return(async t=>{const r=await t.connect(),n=await r.estimateFee(t.payload),i=[];return i.push({feePerUnit:n.lovelacePerByte.toString()}),{type:e.RESPONSES.ESTIMATE_FEE,payload:i}})(r);case e.MESSAGES.PUSH_TRANSACTION:return(async t=>{const r=await t.connect(),n=await r.pushTransaction(t.payload);return{type:e.RESPONSES.PUSH_TRANSACTION,payload:n}})(r);case e.MESSAGES.SUBSCRIBE:return c(r);case e.MESSAGES.UNSUBSCRIBE:return(async r=>{const{payload:n}=r;let i;if("accounts"===n.type)i=await(async({state:t,connect:e},r)=>{t.removeAccounts(r||t.getAccounts());const n=await e(),i=t.getAddresses();return i.length<1?(n.removeAllListeners("notification"),t.removeSubscription("notification"),n.unsubscribeAddresses()):n.subscribeAddresses(i)})(r,n.accounts);else if("addresses"===n.type)i=await(async({state:t,connect:e},r)=>{const n=await e();r||t.removeAccounts(t.getAccounts());const i=t.removeAddresses(r||t.getAddresses());return i.length<1?(n.removeAllListeners("notification"),t.removeSubscription("notification"),n.unsubscribeAddresses()):n.subscribeAddresses(i)})(r,n.addresses);else{if("block"!==n.type)throw new t.CustomError("invalid_param","+type");i=await(async({state:t,connect:e})=>{if(!t.getSubscription("block"))return{subscribed:!1};const r=await e();return r.removeAllListeners("block"),t.removeSubscription("block"),r.unsubscribeBlock()})(r)}return{type:e.RESPONSES.UNSUBSCRIBE,payload:i}})(r);default:throw new t.CustomError("worker_unknown_request",`+${r.type}`)}};class l extends n.BaseWorker{cleanup(){this.api&&(this.api.dispose(),this.api.removeAllListeners()),super.cleanup()}isConnected(t){var e;return null!==(e=null==t?void 0:t.isConnected())&&void 0!==e&&e}async tryConnect(t){const{timeout:r,pingTimeout:n,keepAlive:s}=this.settings,o=new i.BlockfrostAPI({url:t,timeout:r,pingTimeout:n,keepAlive:s,agent:this.proxyAgent});return await o.connect(),o.on("disconnected",(()=>{this.post({id:-1,type:e.RESPONSES.DISCONNECTED,payload:!0}),this.cleanup()})),this.post({id:-1,type:e.RESPONSES.CONNECTED}),o}disconnect(){this.api&&this.api.disconnect()}async messageHandler(t){try{if(await super.messageHandler(t))return!0;const e=Object.assign(Object.assign({},t.data),{connect:()=>this.connect(),post:t=>this.post(t),state:this.state}),r=await a(e);this.post(Object.assign({id:t.data.id},r))}catch(e){this.errorResponse(t.data.id,e)}}}if(function(){return new l},"worker"===n.CONTEXT){const t=new l;onmessage=t.messageHandler.bind(t)}})()})(); \ No newline at end of file diff --git a/app/trezor-prebuild/build/workers/ripple-worker.fb9d5bcfa2137ebed9ad.js b/app/trezor-prebuild/build/workers/ripple-worker.fb9d5bcfa2137ebed9ad.js new file mode 100644 index 0000000000..f77bf06295 --- /dev/null +++ b/app/trezor-prebuild/build/workers/ripple-worker.fb9d5bcfa2137ebed9ad.js @@ -0,0 +1,45 @@ +(()=>{var e={"../../node_modules/asn1.js/lib/asn1.js":(e,t,r)=>{"use strict";const n=t;n.bignum=r("../../node_modules/asn1.js/node_modules/bn.js/lib/bn.js"),n.define=r("../../node_modules/asn1.js/lib/asn1/api.js").define,n.base=r("../../node_modules/asn1.js/lib/asn1/base/index.js"),n.constants=r("../../node_modules/asn1.js/lib/asn1/constants/index.js"),n.decoders=r("../../node_modules/asn1.js/lib/asn1/decoders/index.js"),n.encoders=r("../../node_modules/asn1.js/lib/asn1/encoders/index.js")},"../../node_modules/asn1.js/lib/asn1/api.js":(e,t,r)=>{"use strict";const n=r("../../node_modules/asn1.js/lib/asn1/encoders/index.js"),i=r("../../node_modules/asn1.js/lib/asn1/decoders/index.js"),o=r("../../node_modules/inherits/inherits_browser.js");function s(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new s(e,t)},s.prototype._createNamed=function(e){const t=this.name;function r(e){this._initNamed(e,t)}return o(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},s.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},s.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},s.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},s.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},"../../node_modules/asn1.js/lib/asn1/base/buffer.js":(e,t,r)=>{"use strict";const n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/asn1.js/lib/asn1/base/reporter.js").b,Buffer=r("../../node_modules/safer-buffer/safer.js").Buffer;function o(e,t){i.call(this,t),Buffer.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return s.isEncoderBuffer(e)||(e=new s(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=Buffer.byteLength(e);else{if(!Buffer.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(o,i),t.C=o,o.isDecoderBuffer=function(e){if(e instanceof o)return!0;return"object"==typeof e&&Buffer.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},o.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},o.prototype.restore=function(e){const t=new o(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},o.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new o(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},o.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.R=s,s.isEncoderBuffer=function(e){if(e instanceof s)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},s.prototype.join=function(e,t){return e||(e=Buffer.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(e,t),t+=r.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):Buffer.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},"../../node_modules/asn1.js/lib/asn1/base/index.js":(e,t,r)=>{"use strict";const n=t;n.Reporter=r("../../node_modules/asn1.js/lib/asn1/base/reporter.js").b,n.DecoderBuffer=r("../../node_modules/asn1.js/lib/asn1/base/buffer.js").C,n.EncoderBuffer=r("../../node_modules/asn1.js/lib/asn1/base/buffer.js").R,n.Node=r("../../node_modules/asn1.js/lib/asn1/base/node.js")},"../../node_modules/asn1.js/lib/asn1/base/node.js":(e,t,r)=>{"use strict";const n=r("../../node_modules/asn1.js/lib/asn1/base/reporter.js").b,i=r("../../node_modules/asn1.js/lib/asn1/base/buffer.js").R,o=r("../../node_modules/asn1.js/lib/asn1/base/buffer.js").C,s=r("../../node_modules/minimalistic-assert/index.js"),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function c(e,t,r){const n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=c;const l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){const e=this._baseState,t={};l.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);return r._baseState=t,r},c.prototype._wrap=function(){const e=this._baseState;u.forEach((function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},c.prototype._init=function(e){const t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),s.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){const t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(s(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(r){r==(0|r)&&(r|=0);const n=e[r];t[n]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){c.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),a.forEach((function(e){c.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(r),this}})),c.prototype.use=function(e){s(e);const t=this._baseState;return s(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){const t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){const t=this._baseState;return s(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){const t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},c.prototype.contains=function(e){const t=this._baseState;return s(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){const r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let n,i=r.default,s=!0,a=null;if(null!==r.key&&(a=e.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(s=this._peekTag(e,n,r.any),e.isError(s))return s}else{const n=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),s=!0}catch(e){s=!1}e.restore(n)}}if(r.obj&&s&&(n=e.enterObject()),s){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const n=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(n))return n;r.any?i=e.raw(t):e=n}if(t&&t.track&&null!==r.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(e,t)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new o(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(n,t)}}return r.obj&&s&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==a&&e.exitKey(a):e.leaveKey(a,r.key,i),i},c.prototype._decodeGeneric=function(e,t,r){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},c.prototype._decodeChoice=function(e,t){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(o){const s=e.save(),a=r.choice[o];try{const r=a._decode(e,t);if(e.isError(r))return!1;n={type:o,value:r},i=!0}catch(t){return e.restore(s),!1}return!0}),this),i?n:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},c.prototype._encode=function(e,t,r){const n=this._baseState;if(null!==n.default&&n.default===e)return;const i=this._encodeValue(e,t,r);return void 0===i||this._skipDefault(i,t,r)?void 0:i},c.prototype._encodeValue=function(e,t,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new n);let o=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}let s=null,a=!1;if(i.any)o=this._createEncoderBuffer(e);else if(i.choice)o=this._encodeChoice(e,t);else if(i.contains)s=this._getUse(i.contains,r)._encode(e,t),a=!0;else if(i.children)s=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const n=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const i=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),i}),this).filter((function(e){return e})),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,s=this._createEncoderBuffer(e.map((function(r){const n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)}),r))}else null!==i.use?o=this._getUse(i.use,r)._encode(e,t):(s=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&null===i.choice){const e=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===e?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(e,a,r,s))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(e,t){const r=this._baseState,n=r.choice[e.type];return n||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},"../../node_modules/asn1.js/lib/asn1/base/reporter.js":(e,t,r)=>{"use strict";const n=r("../../node_modules/inherits/inherits_browser.js");function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.b=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){let t;const r=this._reporterState,n=e instanceof o;if(t=n?e:new o(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},"../../node_modules/asn1.js/lib/asn1/constants/der.js":(e,t)=>{"use strict";function r(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=r(t.tag)},"../../node_modules/asn1.js/lib/asn1/constants/index.js":(e,t,r)=>{"use strict";const n=t;n._reverse=function(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r})),t},n.der=r("../../node_modules/asn1.js/lib/asn1/constants/der.js")},"../../node_modules/asn1.js/lib/asn1/decoders/der.js":(e,t,r)=>{"use strict";const n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/asn1.js/node_modules/bn.js/lib/bn.js"),o=r("../../node_modules/asn1.js/lib/asn1/base/buffer.js").C,s=r("../../node_modules/asn1.js/lib/asn1/base/node.js"),a=r("../../node_modules/asn1.js/lib/asn1/constants/der.js");function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){s.call(this,"der",e)}function l(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const n=a.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function d(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(let t=0;t{"use strict";const n=t;n.der=r("../../node_modules/asn1.js/lib/asn1/decoders/der.js"),n.pem=r("../../node_modules/asn1.js/lib/asn1/decoders/pem.js")},"../../node_modules/asn1.js/lib/asn1/decoders/pem.js":(e,t,r)=>{"use strict";const n=r("../../node_modules/inherits/inherits_browser.js"),Buffer=r("../../node_modules/safer-buffer/safer.js").Buffer,i=r("../../node_modules/asn1.js/lib/asn1/decoders/der.js");function o(e){i.call(this,e),this.enc="pem"}n(o,i),e.exports=o,o.prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/;let s=-1,a=-1;for(let e=0;e{"use strict";const n=r("../../node_modules/inherits/inherits_browser.js"),Buffer=r("../../node_modules/safer-buffer/safer.js").Buffer,i=r("../../node_modules/asn1.js/lib/asn1/base/node.js"),o=r("../../node_modules/asn1.js/lib/asn1/constants/der.js");function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new a,this.tree._init(e.body)}function a(e){i.call(this,"der",e)}function u(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(a,i),a.prototype._encodeComposite=function(e,t,r,n){const i=function(e,t,r,n){let i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(o.tagByName.hasOwnProperty(e))i=o.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}if(i>=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=o.tagClassByName[r||"universal"]<<6,i}(e,t,r,this.reporter);if(n.length<128){const e=Buffer.alloc(2);return e[0]=i,e[1]=n.length,this._createEncoderBuffer([e,n])}let s=1;for(let e=n.length;e>=256;e>>=8)s++;const a=Buffer.alloc(2+s);a[0]=i,a[1]=128|s;for(let e=1+s,t=n.length;t>0;e--,t>>=8)a[e]=255&t;return this._createEncoderBuffer([a,n])},a.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=Buffer.alloc(2*e.length);for(let r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t=128;r>>=7)n++}const i=Buffer.alloc(n);let o=i.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(i[o--]=127&r;(r>>=7)>0;)i[o--]=128|127&r}return this._createEncoderBuffer(i)},a.prototype._encodeTime=function(e,t){let r;const n=new Date(e);return"gentime"===t?r=[u(n.getUTCFullYear()),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(n.getUTCFullYear()%100),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},a.prototype._encodeNull=function(){return this._createEncoderBuffer("")},a.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!Buffer.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=Buffer.from(t)}if(Buffer.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=Buffer.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const n=new Array(r);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(Buffer.from(n))},a.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},a.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},a.prototype._skipDefault=function(e,t,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i{"use strict";const n=t;n.der=r("../../node_modules/asn1.js/lib/asn1/encoders/der.js"),n.pem=r("../../node_modules/asn1.js/lib/asn1/encoders/pem.js")},"../../node_modules/asn1.js/lib/asn1/encoders/pem.js":(e,t,r)=>{"use strict";const n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/asn1.js/lib/asn1/encoders/der.js");function o(e){i.call(this,e),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(e,t){const r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"];for(let e=0;e=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=a(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],_=8191&v,w=v>>>13,M=0|s[4],j=8191&M,S=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,O=0|s[6],T=8191&O,P=O>>>13,k=0|s[7],I=8191&k,R=k>>>13,N=0|s[8],C=8191&N,B=N>>>13,L=0|s[9],F=8191&L,D=L>>>13,q=0|a[0],U=8191&q,z=q>>>13,V=0|a[1],$=8191&V,H=V>>>13,K=0|a[2],X=8191&K,Z=K>>>13,J=0|a[3],G=8191&J,W=J>>>13,Y=0|a[4],Q=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],de=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(h,U)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(m,U)|0,o=Math.imul(m,z);var ye=(c+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(b,U)|0,o=Math.imul(b,z),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var be=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var ve=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,z))+Math.imul(S,U)|0,o=Math.imul(S,z),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,W)|0;var _e=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(x,U)|0,o=Math.imul(x,z),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var we=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var Me=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(R,U)|0,o=Math.imul(R,z),n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var je=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,H)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Se=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(D,U)|0,o=Math.imul(D,z),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,H)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Ae=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,H))+Math.imul(D,$)|0,o=Math.imul(D,H),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,he)|0;var Ee=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,Z))+Math.imul(D,X)|0,o=Math.imul(D,Z),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,he)|0;var xe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,G),i=(i=Math.imul(F,W))+Math.imul(D,G)|0,o=Math.imul(D,W),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,he)|0;var Te=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(T,de)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,he)|0;var Pe=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,oe),i=(i=Math.imul(F,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(R,de)|0,o=o+Math.imul(R,he)|0;var ke=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,ce))+Math.imul(D,ue)|0,o=Math.imul(D,ce),n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,he)|0;var Ie=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,de),i=(i=Math.imul(F,he))+Math.imul(D,de)|0,o=Math.imul(D,he);var Re=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(c+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(D,pe)|0))<<13)|0;return c=((o=Math.imul(D,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=_e,u[5]=we,u[6]=Me,u[7]=je,u[8]=Se,u[9]=Ae,u[10]=Ee,u[11]=xe,u[12]=Oe,u[13]=Te,u[14]=Pe,u[15]=ke,u[16]=Ie,u[17]=Re,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new M(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function j(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new j(e)},i(j,M),j.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},j.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},j.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},j.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},j.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/assert/build/assert.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/process/browser.js"),i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var s,a,u=r("../../node_modules/assert/build/internal/errors.js").codes,c=u.ERR_AMBIGUOUS_ARGUMENT,l=u.ERR_INVALID_ARG_TYPE,d=u.ERR_INVALID_ARG_VALUE,h=u.ERR_INVALID_RETURN_VALUE,f=u.ERR_MISSING_ARGS,p=r("../../node_modules/assert/build/internal/assert/assertion_error.js"),m=r("../../node_modules/util/util.js").inspect,g=r("../../node_modules/util/util.js").types,y=g.isPromise,b=g.isRegExp,v=Object.assign?Object.assign:r("../../node_modules/es6-object-assign/index.js").assign,_=Object.is?Object.is:r("../../node_modules/object-is/index.js");new Map;function w(){var e=r("../../node_modules/assert/build/internal/util/comparisons.js");s=e.isDeepEqual,a=e.isDeepStrictEqual}var M=!1,j=e.exports=x,S={};function A(e){if(e.message instanceof Error)throw e.message;throw new p(e)}function E(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new p({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function x(){for(var e=arguments.length,t=new Array(e),r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i{"use strict";var n=r("../../node_modules/process/browser.js");function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;re.length)&&(r=e.length),e.substring(r-t.length,r)===t}var g="",y="",b="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function M(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function j(e,t,r){var i="",o="",s=0,a="",u=!1,c=M(e),l=c.split("\n"),d=M(t).split("\n"),f=0,p="";if("strictEqual"===r&&"object"===h(e)&&"object"===h(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===l.length&&1===d.length&&l[0]!==d[0]){var w=l[0].length+d[0].length;if(w<=10){if(!("object"===h(e)&&null!==e||"object"===h(t)&&null!==t||0===e&&0===t))return"".concat(_[r],"\n\n")+"".concat(l[0]," !== ").concat(d[0],"\n")}else if("strictEqualObject"!==r){if(w<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][f]===d[0][f];)f++;f>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}}for(var j=l[l.length-1],S=d[d.length-1];j===S&&(f++<2?a="\n ".concat(j).concat(a):i=j,l.pop(),d.pop(),0!==l.length&&0!==d.length);)j=l[l.length-1],S=d[d.length-1];var A=Math.max(l.length,d.length);if(0===A){var E=c.split("\n");if(E.length>30)for(E[26]="".concat(g,"...").concat(v);E.length>27;)E.pop();return"".concat(_.notIdentical,"\n\n").concat(E.join("\n"),"\n")}f>3&&(a="\n".concat(g,"...").concat(v).concat(a),u=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var x=0,O=_[r]+"\n".concat(y,"+ actual").concat(v," ").concat(b,"- expected").concat(v),T=" ".concat(g,"...").concat(v," Lines skipped");for(f=0;f1&&f>2&&(P>4?(o+="\n".concat(g,"...").concat(v),u=!0):P>3&&(o+="\n ".concat(d[f-2]),x++),o+="\n ".concat(d[f-1]),x++),s=f,i+="\n".concat(b,"-").concat(v," ").concat(d[f]),x++;else if(d.length1&&f>2&&(P>4?(o+="\n".concat(g,"...").concat(v),u=!0):P>3&&(o+="\n ".concat(l[f-2]),x++),o+="\n ".concat(l[f-1]),x++),s=f,o+="\n".concat(y,"+").concat(v," ").concat(l[f]),x++;else{var k=d[f],I=l[f],R=I!==k&&(!m(I,",")||I.slice(0,-1)!==k);R&&m(k,",")&&k.slice(0,-1)===I&&(R=!1,I+=","),R?(P>1&&f>2&&(P>4?(o+="\n".concat(g,"...").concat(v),u=!0):P>3&&(o+="\n ".concat(l[f-2]),x++),o+="\n ".concat(l[f-1]),x++),s=f,o+="\n".concat(y,"+").concat(v," ").concat(I),i+="\n".concat(b,"-").concat(v," ").concat(k),x+=2):(o+=i,i="",1!==P&&0!==f||(o+="\n ".concat(I),x++))}if(x>20&&f30)for(S[26]="".concat(g,"...").concat(v);S.length>27;)S.pop();r=1===S.length?s(this,d(t).call(this,"".concat(m," ").concat(S[0]))):s(this,d(t).call(this,"".concat(m,"\n\n").concat(S.join("\n"),"\n")))}else{var A=M(c),E="",x=_[o];"notDeepEqual"===o||"notEqual"===o?(A="".concat(_[o],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(E="".concat(M(l)),A.length>512&&(A="".concat(A.slice(0,509),"...")),E.length>512&&(E="".concat(E.slice(0,509),"...")),"deepEqual"===o||"equal"===o?A="".concat(x,"\n\n").concat(A,"\n\nshould equal\n\n"):E=" ".concat(o," ").concat(E)),r=s(this,d(t).call(this,"".concat(A).concat(E)))}return Error.stackTraceLimit=f,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=l,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(r),u),r.stack,r.name="AssertionError",s(r)}var r,u,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e),r=t,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(e,t){return f(this,function(e){for(var t=1;t{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}var a,u,c={};function l(e,t,r){r||(r=Error);var n=function(r){function n(r,s,a){var u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),u=i(this,o(n).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,s,a))),u.code=e,u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(n,r),n}(r);c[e]=n}function d(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,s,u,c;if(void 0===a&&(a=r("../../node_modules/assert/build/assert.js")),a("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(s="not ",t.substr(!u||u<0?0:+u,s.length)===s)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))c="The ".concat(e," ").concat(o," ").concat(d(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";c='The "'.concat(e,'" ').concat(l," ").concat(o," ").concat(d(t,"type"))}return c+=". Received type ".concat(n(i))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r("../../node_modules/util/util.js"));var i=u.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),l("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=c},"../../node_modules/assert/build/internal/util/comparisons.js":(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},a=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},u=Object.is?Object.is:r("../../node_modules/object-is/index.js"),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r("../../node_modules/is-nan/index.js");function d(e){return e.call.bind(e)}var h=d(Object.prototype.hasOwnProperty),f=d(Object.prototype.propertyIsEnumerable),p=d(Object.prototype.toString),m=r("../../node_modules/util/util.js").types,g=m.isAnyArrayBuffer,y=m.isArrayBufferView,b=m.isDate,v=m.isMap,_=m.isRegExp,w=m.isSet,M=m.isNativeError,j=m.isBoxedPrimitive,S=m.isNumberObject,A=m.isStringObject,E=m.isBooleanObject,x=m.isBigIntObject,O=m.isSymbolObject,T=m.isFloat32Array,P=m.isFloat64Array;function k(e){if(0===e.length||e.length>10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function I(e){return Object.keys(e).filter(k).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))} +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */function R(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomError=void 0;const r="blockchain_link/",n={worker_not_found:"Worker not found",worker_invalid:"Invalid worker object",worker_timeout:"Worker timeout",worker_unknown_request:"Unknown message type:",worker_runtime:void 0,invalid_param:"Invalid parameter:",websocket_not_initialized:"WebSocket not initialized",websocket_no_url:"Cannot connect because no server was specified",websocket_timeout:"Websocket timeout",websocket_error_message:void 0,websocket_runtime_error:void 0};class i extends Error{constructor(e,t=""){if(super(t),this.message="",this.message=t,"string"==typeof e){const i=0===e.indexOf(r)?e.substring(16,e.length):e;this.code=`${r}${i}`;const o=n[i];"string"==typeof o&&(""===this.message?this.message=o:0===t.indexOf("+")&&(this.message=`${o} ${t.substring(1)}`))}"string"==typeof this.message&&""!==this.message||(this.message="Message not set")}}t.CustomError=i},"../blockchain-link-types/lib/constants/index.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NETWORKS=t.RESPONSES=t.MESSAGES=void 0;const s=o(r("../blockchain-link-types/lib/constants/messages.js"));t.MESSAGES=s;const a=o(r("../blockchain-link-types/lib/constants/responses.js"));t.RESPONSES=a,t.NETWORKS={RIPPLE:"ripple",BLOCKBOOK:"blockbook",BLOCKFROST:"blockfrost"}},"../blockchain-link-types/lib/constants/messages.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TERMINATE=t.PUSH_TRANSACTION=t.UNSUBSCRIBE=t.SUBSCRIBE=t.ESTIMATE_FEE=t.GET_TRANSACTION=t.GET_ACCOUNT_UTXO=t.GET_ACCOUNT_INFO=t.GET_BLOCK=t.GET_BLOCK_HASH=t.GET_FIAT_RATES_TICKERS_LIST=t.GET_ACCOUNT_BALANCE_HISTORY=t.GET_FIAT_RATES_FOR_TIMESTAMPS=t.GET_CURRENT_FIAT_RATES=t.GET_INFO=t.DISCONNECT=t.CONNECT=t.INIT=t.HANDSHAKE=void 0,t.HANDSHAKE="m_handshake",t.INIT="m_init",t.CONNECT="m_connect",t.DISCONNECT="m_disconnect",t.GET_INFO="m_get_info",t.GET_CURRENT_FIAT_RATES="m_get_current_fiat_rates",t.GET_FIAT_RATES_FOR_TIMESTAMPS="m_get_fiat_rates_for_timestamps",t.GET_ACCOUNT_BALANCE_HISTORY="m_get_account_balance_history",t.GET_FIAT_RATES_TICKERS_LIST="m_get_fiat_rates_tickers_list",t.GET_BLOCK_HASH="m_get_block_hash",t.GET_BLOCK="m_get_block",t.GET_ACCOUNT_INFO="m_get_account_info",t.GET_ACCOUNT_UTXO="m_get_account_utxo",t.GET_TRANSACTION="m_get_transaction",t.ESTIMATE_FEE="m_estimate_fee",t.SUBSCRIBE="m_subscribe",t.UNSUBSCRIBE="m_unsubscribe",t.PUSH_TRANSACTION="m_push_tx",t.TERMINATE="terminate"},"../blockchain-link-types/lib/constants/responses.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NOTIFICATION=t.DISCONNECTED=t.CONNECTED=t.PUSH_TRANSACTION=t.UNSUBSCRIBE=t.SUBSCRIBE=t.ESTIMATE_FEE=t.GET_TRANSACTION=t.GET_ACCOUNT_BALANCE_HISTORY=t.GET_ACCOUNT_UTXO=t.GET_ACCOUNT_INFO=t.GET_FIAT_RATES_TICKERS_LIST=t.GET_FIAT_RATES_FOR_TIMESTAMPS=t.GET_CURRENT_FIAT_RATES=t.GET_BLOCK=t.GET_BLOCK_HASH=t.GET_INFO=t.CONNECT=t.ERROR=void 0,t.ERROR="r_error",t.CONNECT="r_connect",t.GET_INFO="r_info",t.GET_BLOCK_HASH="r_get_block_hash",t.GET_BLOCK="r_get_block",t.GET_CURRENT_FIAT_RATES="r_get_current_fiat_rates",t.GET_FIAT_RATES_FOR_TIMESTAMPS="r_get_fiat_rates_for_timestamps",t.GET_FIAT_RATES_TICKERS_LIST="r_GET_FIAT_RATES_TICKERS_LIST",t.GET_ACCOUNT_INFO="r_account_info",t.GET_ACCOUNT_UTXO="r_get_account_utxo",t.GET_ACCOUNT_BALANCE_HISTORY="r_get_account_balance_history",t.GET_TRANSACTION="r_get_transaction",t.ESTIMATE_FEE="r_estimate_fee",t.SUBSCRIBE="r_subscribe",t.UNSUBSCRIBE="r_unsubscribe",t.PUSH_TRANSACTION="r_push_tx",t.CONNECTED="r_connected",t.DISCONNECTED="r_disconnected",t.NOTIFICATION="r_notification"},"../blockchain-link-utils/lib/ripple.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformTransaction=t.transformServerInfo=void 0;t.transformServerInfo=e=>({name:"Ripple",shortcut:"xrp",testnet:!1,version:e.buildVersion,decimals:6,blockHeight:e.validatedLedger.ledgerVersion,blockHash:e.validatedLedger.hash});t.transformTransaction=(e,t)=>{const r="number"==typeof t.date&&t.date>0?t.date+946684800:t.date;if("Payment"!==t.TransactionType)return{type:"unknown",txid:t.hash,amount:"0",fee:"0",blockTime:r,blockHeight:t.ledger_index,blockHash:t.hash,targets:[],tokens:[],internalTransfers:[],feeRate:void 0,details:{vin:[],vout:[],size:0,totalInput:"0",totalOutput:"0"}};const n=t.Account===e?"sent":"recv",i=[t.Destination],o=t.Amount,s=t.Fee;return{type:n,txid:t.hash,blockTime:r,blockHeight:t.ledger_index,blockHash:t.hash,amount:o,fee:s,targets:[{addresses:i,isAddress:!0,amount:o,n:0}],tokens:[],internalTransfers:[],feeRate:void 0,details:{vin:[],vout:[],size:0,totalInput:"0",totalOutput:"0"}}}},"../blockchain-link/lib/utils/socks-proxy-agent.js":e=>{"use strict";e.exports=e=>({})},"../blockchain-link/lib/workers/baseWorker.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseWorker=t.CONTEXT=void 0;const o=i(r("../blockchain-link/lib/utils/socks-proxy-agent.js")),s=r("../blockchain-link-types/lib/constants/errors.js"),a=r("../blockchain-link/lib/workers/state.js"),u=r("../blockchain-link/lib/workers/utils.js"),c=r("../blockchain-link-types/lib/constants/index.js");t.CONTEXT="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope||"undefined"!=typeof importScripts?"worker":"main";t.BaseWorker=class{constructor(){this.settings={},"worker"===t.CONTEXT?this.post=e=>self.postMessage(e):this.post=e=>this.onmessage({data:e}),this.state=new a.WorkerState,setTimeout((()=>{this.post({id:-1,type:c.MESSAGES.HANDSHAKE})}),10)}debug(...e){if(!this.settings.debug)return;const t=`[Worker "${this.settings.name}"]:`,r=e[0];"warn"===r||"error"===r?console[r](t,...e.slice(1)):console.log(t,...e)}cleanup(){this.api=void 0,this.state.cleanup()}connect(){if(this.isConnected(this.api))return n.resolve(this.api);if(!this.connectPromise){const e=Array.isArray(this.settings.server)?this.settings.server.filter((e=>"string"==typeof e)):[];if(e.length<1)throw new s.CustomError("connect","Endpoint not set");const t=(0,u.prioritizeEndpoints)(e);this.connectPromise=this.connectRecursive(t).then((e=>(this.debug("Connected"),this.api=e,this.connectPromise=void 0,e)))}return this.connectPromise}connectRecursive([e,...t]){if(!e)throw new s.CustomError("connect","All backends are down");return this.proxyAgent&&(this.proxyAgent.protocol=/^(https|wss):/.test(e)?"https:":"http:"),this.debug("Connecting to",e),this.tryConnect(e).catch((e=>(this.debug("Connection failed",e),this.connectRecursive(t))))}disconnect(){}async messageHandler(e){if(!e.data)return!0;const{data:t}=e,{id:r}=t;return this.debug("onmessage",t),t.type===c.MESSAGES.HANDSHAKE?(this.settings=t.settings,this.proxyAgent=t.settings.proxy?(0,o.default)(t.settings.proxy):void 0,!0):t.type===c.MESSAGES.CONNECT?(await this.connect(),this.post({id:r,type:c.RESPONSES.CONNECT,payload:!0}),!0):t.type===c.MESSAGES.DISCONNECT?(this.disconnect(),this.post({id:r,type:c.RESPONSES.DISCONNECTED,payload:!0}),!0):t.type===c.MESSAGES.TERMINATE?(this.disconnect(),this.cleanup(),!0):void 0}errorResponse(e,t){const r={code:"",message:""};t instanceof Error&&(r.message=t.message,r.code=t instanceof s.CustomError&&t.code?t.code:""),this.post({id:e,type:c.RESPONSES.ERROR,payload:r})}postMessage(e){this.messageHandler({data:e})}onmessage(e){}onmessageerror(e){}onerror(e){}terminate(){this.postMessage({id:-1,type:c.MESSAGES.TERMINATE})}}},"../blockchain-link/lib/workers/state.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerState=void 0;const n=r("../blockchain-link-types/lib/constants/errors.js");t.WorkerState=class{constructor(){this.addresses=[],this.accounts=[],this.subscription={}}validateAddresses(e){if(!Array.isArray(e))throw new n.CustomError("invalid_param","+addresses");const t=[];return e.filter((e=>"string"==typeof e&&(!(t.indexOf(e)>=0)&&(t.push(e),!0))))}addAddresses(e){const t=this.validateAddresses(e).filter((e=>this.addresses.indexOf(e)<0));return this.addresses=this.addresses.concat(t),t}getAddresses(){return this.addresses}removeAddresses(e){const t=this.validateAddresses(e);return this.addresses=this.addresses.filter((e=>t.indexOf(e)<0)),this.addresses}validateAccounts(e){if(!Array.isArray(e))throw new n.CustomError("invalid_param","+accounts");const t=[];return e.filter((e=>!(!e||"object"!=typeof e||"string"!=typeof e.descriptor)&&(!(t.indexOf(e.descriptor)>=0)&&(t.push(e.descriptor),!0))))}getAccountAddresses(e){if(e.addresses){const{change:t,used:r,unused:n}=e.addresses;return t.concat(r,n).map((e=>e.address))}return[e.descriptor]}addAccounts(e){const t=this.validateAccounts(e),r=this.accounts.filter((e=>!t.find((t=>t.descriptor===e.descriptor))));this.accounts=r.concat(t);const n=this.accounts.reduce(((e,t)=>e.concat(this.getAccountAddresses(t))),[]);return this.addAddresses(n),t}getAccount(e){return this.accounts.find((t=>{if(t.descriptor===e)return!0;if(t.addresses){const{change:r,used:n,unused:i}=t.addresses;if(r.find((t=>t.address===e)))return!0;if(n.find((t=>t.address===e)))return!0;if(i.find((t=>t.address===e)))return!0}return!1}))}getAccounts(){return this.accounts}removeAccounts(e){const t=this.validateAccounts(e),r=this.accounts.filter((e=>t.find((t=>t.descriptor===e.descriptor)))),n=r.reduce(((e,t)=>e.concat(this.getAccountAddresses(t))),[]);return this.accounts=this.accounts.filter((e=>r.indexOf(e)<0)),this.removeAddresses(n),this.accounts}addSubscription(e){this.subscription[e]=!0}getSubscription(e){return this.subscription[e]}hasSubscriptions(){return Object.keys(this.subscription).length>0}removeSubscription(e){delete this.subscription[e]}clearSubscriptions(){Object.keys(this.subscription).forEach((e=>{delete this.subscription[e]}))}removeEmpty(e){return Object.keys(e).forEach((t=>{Array.isArray(e[t])&&e[t].map((e=>this.removeEmpty(e))),e[t]&&"object"==typeof e[t]?this.removeEmpty(e[t]):void 0===e[t]&&delete e[t]})),e}cleanup(){this.removeAccounts(this.getAccounts()),this.removeAddresses(this.getAddresses()),this.clearSubscriptions()}}},"../blockchain-link/lib/workers/utils.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prioritizeEndpoints=void 0;const n=r("../utils/lib/index.js");t.prioritizeEndpoints=e=>e.map((e=>{const t=(0,n.parseHostname)(e);let r=Math.random();return"localhost"===t||"127.0.0.1"===t?r+=2:(null==t?void 0:t.endsWith(".onion"))&&(r+=1),[e,r]})).sort((([,e],[,t])=>t-e)).map((([e])=>e))},"../utils/lib/arrayDistinct.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayDistinct=void 0;t.arrayDistinct=(e,t,r)=>r.indexOf(e)===t},"../utils/lib/arrayPartition.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayPartition=void 0;t.arrayPartition=(e,t)=>e.reduce((([e,r],n)=>t(n)?[[...e,n],r]:[e,[...r,n]]),[[],[]])},"../utils/lib/arrayShuffle.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayShuffle=void 0;t.arrayShuffle=e=>{const t=e.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1));[t[e],t[r]]=[t[r],t[e]]}return t}},"../utils/lib/arrayToDictionary.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayToDictionary=void 0;const r=e=>!!["string","number"].includes(typeof e);t.arrayToDictionary=(e,t,n)=>n?e.reduce(((e,n)=>{var i;const o=t(n);return r(o)?Object.assign(Object.assign({},e),{[o]:[...null!==(i=e[o])&&void 0!==i?i:[],n]}):e}),{}):e.reduce(((e,n)=>{const i=t(n);return r(i)?Object.assign(Object.assign({},e),{[i]:n}):e}),{})},"../utils/lib/bufferUtils.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.getChunkSize=t.reverseBuffer=void 0;t.reverseBuffer=e=>{if(e.length<1)return e;const t=Buffer.alloc(e.length);let r=t.length-1;for(let n=0;n{const t=Buffer.allocUnsafe(1);return t.writeUInt8(e),t}},"../utils/lib/bytesToHumanReadable.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bytesToHumanReadable=void 0;const r=["B","KB","MB","GB","TB"];t.bytesToHumanReadable=e=>{let t=Math.abs(e),n=0;for(;t>=1024||n>=r.length;)t/=1024,n++;return`${t.toFixed(1)} ${r[n]}`}},"../utils/lib/capitalizeFirstLetter.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.capitalizeFirstLetter=void 0;t.capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1)},"../utils/lib/cloneObject.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneObject=void 0;t.cloneObject=e=>{const t=JSON.stringify(e);return void 0===t?e:JSON.parse(t)}},"../utils/lib/countBytesInString.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.countBytesInString=void 0;t.countBytesInString=e=>encodeURI(e).split(/%..|./).length-1},"../utils/lib/createCooldown.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCooldown=void 0;t.createCooldown=e=>{let t=0;return()=>{const r=Date.now();return r-t>=e&&(t=r,!0)}}},"../utils/lib/createDeferred.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferred=void 0;t.createDeferred=e=>{let t=()=>{},r=()=>{};const i=new n(((e,n)=>{t=e,r=n}));return{id:e,resolve:t,reject:r,promise:i}}},"../utils/lib/createTimeoutPromise.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.createTimeoutPromise=void 0;t.createTimeoutPromise=e=>new n((t=>setTimeout(t,e)))},"../utils/lib/enumUtils.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getValueByKey=t.getKeyByValue=void 0,t.getKeyByValue=function(e,t){return e&&Object.keys(e).find((r=>e[r]===t))},t.getValueByKey=function(e,t){const r=e&&Object.keys(e).find((e=>e===t));return r&&e[r]}},"../utils/lib/getLocaleSeparators.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLocaleSeparators=void 0;t.getLocaleSeparators=e=>{var t,r;const n=new Intl.NumberFormat(e).formatToParts(10000.1);return{decimalSeparator:null===(t=n.find((({type:e})=>"decimal"===e)))||void 0===t?void 0:t.value,thousandsSeparator:null===(r=n.find((({type:e})=>"group"===e)))||void 0===r?void 0:r.value}}},"../utils/lib/getNumberFromPixelString.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNumberFromPixelString=void 0;t.getNumberFromPixelString=e=>parseInt(e.replace("px",""),10)},"../utils/lib/getRandomNumberInRange.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRandomNumberInRange=void 0;t.getRandomNumberInRange=(e,t)=>Math.floor(Math.random()*(t-e+1))+e},"../utils/lib/getSynchronize.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0}),t.getSynchronize=void 0;t.getSynchronize=()=>{let e;return t=>{const r=(null!=e?e:n.resolve()).catch((()=>{})).then(t).finally((()=>{e===r&&(e=void 0)}));return e=r,e}}},"../utils/lib/getWeakRandomId.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWeakRandomId=void 0;t.getWeakRandomId=e=>{let t="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasUppercaseLetter=void 0;const r=new RegExp("^(.*[A-Z].*)$");t.hasUppercaseLetter=e=>r.test(e)},"../utils/lib/index.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.xssFilters=t.versionUtils=t.enumUtils=t.bufferUtils=void 0,o(r("../utils/lib/arrayDistinct.js"),t),o(r("../utils/lib/arrayPartition.js"),t),o(r("../utils/lib/arrayShuffle.js"),t),o(r("../utils/lib/arrayToDictionary.js"),t),t.bufferUtils=s(r("../utils/lib/bufferUtils.js")),o(r("../utils/lib/bytesToHumanReadable.js"),t),o(r("../utils/lib/capitalizeFirstLetter.js"),t),o(r("../utils/lib/cloneObject.js"),t),o(r("../utils/lib/countBytesInString.js"),t),o(r("../utils/lib/createCooldown.js"),t),o(r("../utils/lib/createDeferred.js"),t),o(r("../utils/lib/createTimeoutPromise.js"),t),t.enumUtils=s(r("../utils/lib/enumUtils.js")),o(r("../utils/lib/getNumberFromPixelString.js"),t),o(r("../utils/lib/getRandomNumberInRange.js"),t),o(r("../utils/lib/getSynchronize.js"),t),o(r("../utils/lib/getWeakRandomId.js"),t),o(r("../utils/lib/hasUppercaseLetter.js"),t),o(r("../utils/lib/isAscii.js"),t),o(r("../utils/lib/isHex.js"),t),o(r("../utils/lib/isNotUndefined.js"),t),o(r("../utils/lib/isUrl.js"),t),o(r("../utils/lib/mergeDeepObject.js"),t),o(r("../utils/lib/objectPartition.js"),t),o(r("../utils/lib/parseElectrumUrl.js"),t),o(r("../utils/lib/parseHostname.js"),t),o(r("../utils/lib/promiseAllSequence.js"),t),o(r("../utils/lib/redactUserPath.js"),t),o(r("../utils/lib/scheduleAction.js"),t),o(r("../utils/lib/throwError.js"),t),o(r("../utils/lib/truncateMiddle.js"),t),o(r("../utils/lib/topologicalSort.js"),t),o(r("../utils/lib/urlToOnion.js"),t),t.versionUtils=s(r("../utils/lib/versionUtils.js")),t.xssFilters=s(r("../utils/lib/xssFilters.js")),o(r("../utils/lib/getLocaleSeparators.js"),t)},"../utils/lib/isAscii.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAscii=void 0,t.isAscii=function(e){return!e||/^[\x00-\x7F]*$/.test(e)}},"../utils/lib/isHex.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHex=void 0;t.isHex=e=>/^(0x|0X)?[0-9A-Fa-f]+$/g.test(e)},"../utils/lib/isNotUndefined.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNotUndefined=void 0;t.isNotUndefined=e=>void 0!==e},"../utils/lib/isUrl.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUrl=void 0;const r=/^(http|ws)s?:\/\/[a-z0-9]([a-z0-9.-]+)?(:[0-9]{1,5})?((\/)?(([a-z0-9-_])+(\/)?)+)$/i;t.isUrl=e=>r.test(e)},"../utils/lib/mergeDeepObject.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeDeepObject=void 0;const r=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1};t.mergeDeepObject=(...e)=>e.reduce(((e,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach((i=>{["__proto__","constructor","prototype"].includes(i)||(Array.isArray(e[i])&&Array.isArray(n[i])?e[i]=t.mergeDeepObject.options.mergeArrays?Array.from(new Set(e[i].concat(n[i]))):n[i]:r(e[i])&&r(n[i])?e[i]=(0,t.mergeDeepObject)(e[i],n[i]):e[i]=n[i])})),e}),{});const n={mergeArrays:!0};t.mergeDeepObject.options=n,t.mergeDeepObject.withOptions=(e,...r)=>{t.mergeDeepObject.options=Object.assign({mergeArrays:!0},e);const i=(0,t.mergeDeepObject)(...r);return t.mergeDeepObject.options=n,i}},"../utils/lib/objectPartition.js":function(e,t){"use strict";var r=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);it.reduce((([e,t],n)=>{const i=t,o=n,s=i[o],a=r(i,["symbol"==typeof o?o:o+""]);return void 0!==s?[Object.assign(Object.assign({},e),{[n]:s}),a]:[e,t]}),[{},e])},"../utils/lib/parseElectrumUrl.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseElectrumUrl=void 0;const r=/^(?:([a-zA-Z0-9.-]+)|\[([a-f0-9:]+)\]):([0-9]{1,5}):([ts])$/;t.parseElectrumUrl=e=>{var t;const n=e.match(r);if(n)return{host:null!==(t=n[1])&&void 0!==t?t:n[2],port:Number.parseInt(n[3],10),protocol:n[4]}}},"../utils/lib/parseHostname.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseHostname=void 0;const r=/^([a-z0-9.+-]+:\/\/)?([a-z0-9.-]+)([:/][^:/]+)*\/?$/i;t.parseHostname=e=>{var t,n;return null===(n=null===(t=e.match(r))||void 0===t?void 0:t[2])||void 0===n?void 0:n.toLowerCase()}},"../utils/lib/promiseAllSequence.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.promiseAllSequence=void 0;t.promiseAllSequence=e=>i(void 0,void 0,void 0,(function*(){const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.redactUserPathFromString=t.startOfUserPathRegex=void 0,t.startOfUserPathRegex=/([/\\][Uu]sers[/\\]{1,4})([^"^'^[^\]^/^\\]*)/g;t.redactUserPathFromString=e=>e.replace(t.startOfUserPathRegex,"$1[*]")},"../utils/lib/scheduleAction.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.scheduleAction=void 0;const o=e=>Array.isArray(e),s=()=>new Error("Aborted by signal"),a=()=>new Error("Aborted by deadline"),u=()=>new Error("Aborted by timeout"),c=(e,t)=>new n(((r,n)=>{if(t.aborted)return n();if(void 0===e)return r();const i=setTimeout(r,e),o=()=>{clearTimeout(i),t.removeEventListener("abort",o),n()};t.addEventListener("abort",o)})),l=(e,t,r)=>new n(((n,i)=>{if(r.aborted)return i();const o=void 0!==e?setTimeout((()=>i(t())),e):void 0,s=()=>{clearTimeout(o),r.removeEventListener("abort",s),i()};r.addEventListener("abort",s)})),d=(e,t)=>new n(((r,n)=>{if(t.aborted)return n();if(null==e?void 0:e.aborted)return n(s());const i=()=>n(s());null==e||e.addEventListener("abort",i);const o=()=>{null==e||e.removeEventListener("abort",i),t.removeEventListener("abort",o),n()};t.addEventListener("abort",o)})),h=(e,t)=>i(void 0,void 0,void 0,(function*(){const r=new AbortController,i=()=>r.abort();t.aborted&&i(),t.addEventListener("abort",i);try{return yield new n((t=>t(e(r.signal))))}finally{t.removeEventListener("abort",i)}}));t.scheduleAction=(e,t)=>i(void 0,void 0,void 0,(function*(){const{signal:r,delay:s,attempts:f,timeout:p,deadline:m,gap:g}=t,y=m&&m-Date.now(),b=o(f)?f.length:null!=f?f:m?1/0:1,v=new AbortController,_=v.signal,w=o(f)?e=>f[e]:()=>({timeout:p,gap:g});try{return yield n.race([d(r,_),l(y,a,_),c(s,_).then((()=>((e,t,r,o)=>i(void 0,void 0,void 0,(function*(){for(let n=0;ne.abort();o.addEventListener("abort",i);try{return yield t(n,e.signal)}catch(e){i(),yield r(n)}finally{o.removeEventListener("abort",i)}}return o.aborted?n.reject():t(e-1,o)})))(b,((t,r)=>n.race([l(w(t).timeout,u,_),h(e,r)])),(e=>{var t;return c(null!==(t=w(e).gap)&&void 0!==t?t:0,_)}),_)))])}finally{v.abort()}}))},"../utils/lib/throwError.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwError=void 0;t.throwError=e=>{throw new Error(e)}},"../utils/lib/topologicalSort.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.topologicalSort=void 0;const n=r("../utils/lib/arrayPartition.js");t.topologicalSort=(e,t,r)=>{const i=[],o=e=>(0,n.arrayPartition)(e,(r=>!e.some((e=>t(e,r)))));let s=e;for(;s.length;){const[e,t]=o(s);if(!e.length)throw new Error("Cycle detected");i.push(...r?e.sort(r):e),s=t}return i}},"../utils/lib/truncateMiddle.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.truncateMiddle=void 0;t.truncateMiddle=(e,t,r)=>{if(e.length<=t+r)return e;return`${e.substring(0,t)}…${e.substring(e.length-r,e.length)}`}},"../utils/lib/urlToOnion.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.urlToOnion=void 0;t.urlToOnion=(e,t)=>{var r;const[,n,i,o,s]=null!==(r=e.match(/^(http|ws)s?:\/\/([^:/]+\.)?([^/.]+\.[^/.]+)(\/.*)?$/i))&&void 0!==r?r:[];if(o&&t[o])return`${n}://${null!=i?i:""}${t[o]}${null!=s?s:""}`}},"../utils/lib/versionUtils.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeVersion=t.isNewerOrEqual=t.isEqual=t.isNewer=t.isVersionArray=void 0;t.isVersionArray=e=>{if(!Array.isArray(e))return!1;if(3!==e.length)return!1;for(let t=0;t({major:e[0],minor:e[1],patch:e[2]}),n=e=>{const r=e.split(".").map((e=>Number(e)));if(!(0,t.isVersionArray)(r))throw new Error("version string is in wrong format");return r},i=e=>`${e[0]}.${e[1]}.${e[2]}`;t.isNewer=(e,t)=>{const i=r("string"==typeof e?n(e):e),o=r("string"==typeof t?n(t):t);return i.major-o.major!=0?i.major>o.major:i.minor-o.minor!=0?i.minor>o.minor:i.patch-o.patch!=0&&i.patch>o.patch};t.isEqual=(e,t)=>("string"==typeof e?e:i(e))===("string"==typeof t?t:i(t));t.isNewerOrEqual=(e,r)=>(0,t.isNewer)(e,r)||(0,t.isEqual)(e,r);t.normalizeVersion=e=>e.replace(/\b0+(\d)/g,"$1")},"../utils/lib/xssFilters.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inDoubleQuotes=t.inSingleQuotes=t.inHTML=void 0;const r=/e.replace(r,"<");t.inSingleQuotes=e=>e.replace(n,"'");t.inDoubleQuotes=e=>e.replace(i,""")},"../../node_modules/base-x/src/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,l=new Uint8Array(s);e[r];){var d=t[e.charCodeAt(r)];if(255===d)return;for(var h=0,f=s-1;(0!==d||h>>0,l[f]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error("Non-zero carry");o=h,r++}for(var p=s-o;p!==s&&0===l[p];)p++;var m=n.allocUnsafe(i+(s-p));m.fill(0,0,i);for(var g=i;p!==s;)m[g++]=l[p++];return m}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,s=t.length;o!==s&&0===t[o];)o++,r++;for(var c=(s-o)*l+1>>>0,d=new Uint8Array(c);o!==s;){for(var h=t[o],f=0,p=c-1;(0!==h||f>>0,d[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");i=f,o++}for(var m=c-i;m!==c&&0===d[m];)m++;for(var g=u.repeat(r);m{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),l=0,d=u>0?s-4:s;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;ac?c:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,s=[],a=t;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},"../../node_modules/big-integer/BigInteger.js":(e,t,r)=>{var n;e=r.nmd(e);var i=function(e){"use strict";var t=1e7,r=7,n=9007199254740992,o=h(n),s="0123456789abcdefghijklmnopqrstuvwxyz",a="function"==typeof BigInt;function u(e,t,r,n){return void 0===e?u[0]:void 0!==t&&(10!=+t||r)?H(e,t,r,n):G(e)}function BigInteger(e,t){this.value=e,this.sign=t,this.isSmall=!1}function c(e){this.value=e,this.sign=e<0,this.isSmall=!0}function l(e){this.value=e}function d(e){return-n0?Math.floor(e):Math.ceil(e)}function y(e,r){var n,i,o=e.length,s=r.length,a=new Array(o),u=0,c=t;for(i=0;i=c?1:0,a[i]=n-u*c;for(;i0&&a.push(u),a}function b(e,t){return e.length>=t.length?y(e,t):y(t,e)}function v(e,r){var n,i,o=e.length,s=new Array(o),a=t;for(i=0;i0;)s[i++]=r%a,r=Math.floor(r/a);return s}function _(e,r){var n,i,o=e.length,s=r.length,a=new Array(o),u=0,c=t;for(n=0;n0;)s[i++]=u%a,u=Math.floor(u/a);return s}function S(e,t){for(var r=[];t-- >0;)r.push(0);return r.concat(e)}function A(e,t){var r=Math.max(e.length,t.length);if(r<=30)return M(e,t);r=Math.ceil(r/2);var n=e.slice(r),i=e.slice(0,r),o=t.slice(r),s=t.slice(0,r),a=A(i,s),u=A(n,o),c=A(b(i,n),b(s,o)),l=b(b(a,S(_(_(c,a),u),r)),S(u,2*r));return p(l),l}function E(e,r,n){return new BigInteger(e=0;--n)o=(s=o*c+e[n])-(i=g(s/r))*r,u[n]=0|i;return[u,0|o]}function T(e,r){var n,i=G(r);if(a)return[new l(e.value/i.value),new l(e.value%i.value)];var o,s=e.value,d=i.value;if(0===d)throw new Error("Cannot divide by zero");if(e.isSmall)return i.isSmall?[new c(g(s/d)),new c(s%d)]:[u[0],e];if(i.isSmall){if(1===d)return[e,u[0]];if(-1==d)return[e.negate(),u[0]];var y=Math.abs(d);if(y=0;i--){for(n=h-1,b[i+d]!==g&&(n=Math.floor((b[i+d]*h+b[i+d-1])/g)),o=0,s=0,u=v.length,a=0;ac&&(o=(o+1)*h),n=Math.ceil(o/s);do{if(P(a=j(r,n),d)<=0)break;n--}while(n);l.push(n),d=_(d,a)}return l.reverse(),[f(l),f(d)]}(s,d),o=n[0];var w=e.sign!==i.sign,M=n[1],S=e.sign;return"number"==typeof o?(w&&(o=-o),o=new c(o)):o=new BigInteger(o,w),"number"==typeof M?(S&&(M=-M),M=new c(M)):M=new BigInteger(M,S),[o,M]}function P(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var r=e.length-1;r>=0;r--)if(e[r]!==t[r])return e[r]>t[r]?1:-1;return 0}function k(e){var t=e.abs();return!t.isUnit()&&(!!(t.equals(2)||t.equals(3)||t.equals(5))||!(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))&&(!!t.lesser(49)||void 0))}function I(e,t){for(var r,n,o,s=e.prev(),a=s,u=0;a.isEven();)a=a.divide(2),u++;e:for(n=0;n=0?n=_(e,t):(n=_(t,e),r=!r),"number"==typeof(n=f(n))?(r&&(n=-n),new c(n)):new BigInteger(n,r)}(r,n,this.sign)},BigInteger.prototype.minus=BigInteger.prototype.subtract,c.prototype.subtract=function(e){var t=G(e),r=this.value;if(r<0!==t.sign)return this.add(t.negate());var n=t.value;return t.isSmall?new c(r-n):w(n,Math.abs(r),r>=0)},c.prototype.minus=c.prototype.subtract,l.prototype.subtract=function(e){return new l(this.value-G(e).value)},l.prototype.minus=l.prototype.subtract,BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)},c.prototype.negate=function(){var e=this.sign,t=new c(-this.value);return t.sign=!e,t},l.prototype.negate=function(){return new l(-this.value)},BigInteger.prototype.abs=function(){return new BigInteger(this.value,!1)},c.prototype.abs=function(){return new c(Math.abs(this.value))},l.prototype.abs=function(){return new l(this.value>=0?this.value:-this.value)},BigInteger.prototype.multiply=function(e){var r,n,i,o=G(e),s=this.value,a=o.value,c=this.sign!==o.sign;if(o.isSmall){if(0===a)return u[0];if(1===a)return this;if(-1===a)return this.negate();if((r=Math.abs(a))0?A(s,a):M(s,a),c)},BigInteger.prototype.times=BigInteger.prototype.multiply,c.prototype._multiplyBySmall=function(e){return d(e.value*this.value)?new c(e.value*this.value):E(Math.abs(e.value),h(Math.abs(this.value)),this.sign!==e.sign)},BigInteger.prototype._multiplyBySmall=function(e){return 0===e.value?u[0]:1===e.value?this:-1===e.value?this.negate():E(Math.abs(e.value),this.value,this.sign!==e.sign)},c.prototype.multiply=function(e){return G(e)._multiplyBySmall(this)},c.prototype.times=c.prototype.multiply,l.prototype.multiply=function(e){return new l(this.value*G(e).value)},l.prototype.times=l.prototype.multiply,BigInteger.prototype.square=function(){return new BigInteger(x(this.value),!1)},c.prototype.square=function(){var e=this.value*this.value;return d(e)?new c(e):new BigInteger(x(h(Math.abs(this.value))),!1)},l.prototype.square=function(e){return new l(this.value*this.value)},BigInteger.prototype.divmod=function(e){var t=T(this,e);return{quotient:t[0],remainder:t[1]}},l.prototype.divmod=c.prototype.divmod=BigInteger.prototype.divmod,BigInteger.prototype.divide=function(e){return T(this,e)[0]},l.prototype.over=l.prototype.divide=function(e){return new l(this.value/G(e).value)},c.prototype.over=c.prototype.divide=BigInteger.prototype.over=BigInteger.prototype.divide,BigInteger.prototype.mod=function(e){return T(this,e)[1]},l.prototype.mod=l.prototype.remainder=function(e){return new l(this.value%G(e).value)},c.prototype.remainder=c.prototype.mod=BigInteger.prototype.remainder=BigInteger.prototype.mod,BigInteger.prototype.pow=function(e){var t,r,n,i=G(e),o=this.value,s=i.value;if(0===s)return u[1];if(0===o)return u[0];if(1===o)return u[1];if(-1===o)return i.isEven()?u[1]:u[-1];if(i.sign)return u[0];if(!i.isSmall)throw new Error("The exponent "+i.toString()+" is too large.");if(this.isSmall&&d(t=Math.pow(o,s)))return new c(g(t));for(r=this,n=u[1];!0&s&&(n=n.times(r),--s),0!==s;)s/=2,r=r.square();return n},c.prototype.pow=BigInteger.prototype.pow,l.prototype.pow=function(e){var t=G(e),r=this.value,n=t.value,i=BigInt(0),o=BigInt(1),s=BigInt(2);if(n===i)return u[1];if(r===i)return u[0];if(r===o)return u[1];if(r===BigInt(-1))return t.isEven()?u[1]:u[-1];if(t.isNegative())return new l(i);for(var a=this,c=u[1];(n&o)===o&&(c=c.times(a),--n),n!==i;)n/=s,a=a.square();return c},BigInteger.prototype.modPow=function(e,t){if(e=G(e),(t=G(t)).isZero())throw new Error("Cannot take modPow with modulus 0");var r=u[1],n=this.mod(t);for(e.isNegative()&&(e=e.multiply(u[-1]),n=n.modInv(t));e.isPositive();){if(n.isZero())return u[0];e.isOdd()&&(r=r.multiply(n).mod(t)),e=e.divide(2),n=n.square().mod(t)}return r},l.prototype.modPow=c.prototype.modPow=BigInteger.prototype.modPow,BigInteger.prototype.compareAbs=function(e){var t=G(e),r=this.value,n=t.value;return t.isSmall?1:P(r,n)},c.prototype.compareAbs=function(e){var t=G(e),r=Math.abs(this.value),n=t.value;return t.isSmall?r===(n=Math.abs(n))?0:r>n?1:-1:-1},l.prototype.compareAbs=function(e){var t=this.value,r=G(e).value;return(t=t>=0?t:-t)===(r=r>=0?r:-r)?0:t>r?1:-1},BigInteger.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=G(e),r=this.value,n=t.value;return this.sign!==t.sign?t.sign?1:-1:t.isSmall?this.sign?-1:1:P(r,n)*(this.sign?-1:1)},BigInteger.prototype.compareTo=BigInteger.prototype.compare,c.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=G(e),r=this.value,n=t.value;return t.isSmall?r==n?0:r>n?1:-1:r<0!==t.sign?r<0?-1:1:r<0?1:-1},c.prototype.compareTo=c.prototype.compare,l.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=this.value,r=G(e).value;return t===r?0:t>r?1:-1},l.prototype.compareTo=l.prototype.compare,BigInteger.prototype.equals=function(e){return 0===this.compare(e)},l.prototype.eq=l.prototype.equals=c.prototype.eq=c.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals,BigInteger.prototype.notEquals=function(e){return 0!==this.compare(e)},l.prototype.neq=l.prototype.notEquals=c.prototype.neq=c.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals,BigInteger.prototype.greater=function(e){return this.compare(e)>0},l.prototype.gt=l.prototype.greater=c.prototype.gt=c.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater,BigInteger.prototype.lesser=function(e){return this.compare(e)<0},l.prototype.lt=l.prototype.lesser=c.prototype.lt=c.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser,BigInteger.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},l.prototype.geq=l.prototype.greaterOrEquals=c.prototype.geq=c.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals,BigInteger.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},l.prototype.leq=l.prototype.lesserOrEquals=c.prototype.leq=c.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals,BigInteger.prototype.isEven=function(){return 0==(1&this.value[0])},c.prototype.isEven=function(){return 0==(1&this.value)},l.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},BigInteger.prototype.isOdd=function(){return 1==(1&this.value[0])},c.prototype.isOdd=function(){return 1==(1&this.value)},l.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},BigInteger.prototype.isPositive=function(){return!this.sign},c.prototype.isPositive=function(){return this.value>0},l.prototype.isPositive=c.prototype.isPositive,BigInteger.prototype.isNegative=function(){return this.sign},c.prototype.isNegative=function(){return this.value<0},l.prototype.isNegative=c.prototype.isNegative,BigInteger.prototype.isUnit=function(){return!1},c.prototype.isUnit=function(){return 1===Math.abs(this.value)},l.prototype.isUnit=function(){return this.abs().value===BigInt(1)},BigInteger.prototype.isZero=function(){return!1},c.prototype.isZero=function(){return 0===this.value},l.prototype.isZero=function(){return this.value===BigInt(0)},BigInteger.prototype.isDivisibleBy=function(e){var t=G(e);return!t.isZero()&&(!!t.isUnit()||(0===t.compareAbs(2)?this.isEven():this.mod(t).isZero()))},l.prototype.isDivisibleBy=c.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy,BigInteger.prototype.isPrime=function(t){var r=k(this);if(r!==e)return r;var n=this.abs(),o=n.bitLength();if(o<=64)return I(n,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var s=Math.log(2)*o.toJSNumber(),a=Math.ceil(!0===t?2*Math.pow(s,2):s),u=[],c=0;c-n?new c(e-1):new BigInteger(o,!0)},l.prototype.prev=function(){return new l(this.value-BigInt(1))};for(var R=[1];2*R[R.length-1]<=t;)R.push(2*R[R.length-1]);var N=R.length,C=R[N-1];function B(e){return Math.abs(e)<=t}function L(e,t,r){t=G(t);for(var n=e.isNegative(),o=t.isNegative(),s=n?e.not():e,a=o?t.not():t,u=0,c=0,l=null,d=null,h=[];!s.isZero()||!a.isZero();)u=(l=T(s,C))[1].toJSNumber(),n&&(u=C-1-u),c=(d=T(a,C))[1].toJSNumber(),o&&(c=C-1-c),s=l[0],a=d[0],h.push(r(u,c));for(var f=0!==r(n?1:0,o?1:0)?i(-1):i(0),p=h.length-1;p>=0;p-=1)f=f.multiply(C).add(i(h[p]));return f}BigInteger.prototype.shiftLeft=function(e){var t=G(e).toJSNumber();if(!B(t))throw new Error(String(t)+" is too large for shifting.");if(t<0)return this.shiftRight(-t);var r=this;if(r.isZero())return r;for(;t>=N;)r=r.multiply(C),t-=N-1;return r.multiply(R[t])},l.prototype.shiftLeft=c.prototype.shiftLeft=BigInteger.prototype.shiftLeft,BigInteger.prototype.shiftRight=function(e){var t,r=G(e).toJSNumber();if(!B(r))throw new Error(String(r)+" is too large for shifting.");if(r<0)return this.shiftLeft(-r);for(var n=this;r>=N;){if(n.isZero()||n.isNegative()&&n.isUnit())return n;n=(t=T(n,C))[1].isNegative()?t[0].prev():t[0],r-=N-1}return(t=T(n,R[r]))[1].isNegative()?t[0].prev():t[0]},l.prototype.shiftRight=c.prototype.shiftRight=BigInteger.prototype.shiftRight,BigInteger.prototype.not=function(){return this.negate().prev()},l.prototype.not=c.prototype.not=BigInteger.prototype.not,BigInteger.prototype.and=function(e){return L(this,e,(function(e,t){return e&t}))},l.prototype.and=c.prototype.and=BigInteger.prototype.and,BigInteger.prototype.or=function(e){return L(this,e,(function(e,t){return e|t}))},l.prototype.or=c.prototype.or=BigInteger.prototype.or,BigInteger.prototype.xor=function(e){return L(this,e,(function(e,t){return e^t}))},l.prototype.xor=c.prototype.xor=BigInteger.prototype.xor;var F=1<<30,D=(t&-t)*(t&-t)|F;function q(e){var r=e.value,n="number"==typeof r?r|F:"bigint"==typeof r?r|BigInt(F):r[0]+r[1]*t|D;return n&-n}function U(e,t){if(t.compareTo(e)<=0){var r=U(e,t.square(t)),n=r.p,o=r.e,s=n.multiply(t);return s.compareTo(e)<=0?{p:s,e:2*o+1}:{p:n,e:2*o}}return{p:i(1),e:0}}function z(e,t){return e=G(e),t=G(t),e.greater(t)?e:t}function V(e,t){return e=G(e),t=G(t),e.lesser(t)?e:t}function $(e,t){if(e=G(e).abs(),t=G(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var r,n,i=u[1];e.isEven()&&t.isEven();)r=V(q(e),q(t)),e=e.divide(r),t=t.divide(r),i=i.multiply(r);for(;e.isEven();)e=e.divide(q(e));do{for(;t.isEven();)t=t.divide(q(t));e.greater(t)&&(n=t,t=e,e=n),t=t.subtract(e)}while(!t.isZero());return i.isUnit()?e:e.multiply(i)}BigInteger.prototype.bitLength=function(){var e=this;return e.compareTo(i(0))<0&&(e=e.negate().subtract(i(1))),0===e.compareTo(i(0))?i(0):i(U(e,i(2)).e).add(i(1))},l.prototype.bitLength=c.prototype.bitLength=BigInteger.prototype.bitLength;var H=function(e,t,r,n){r=r||s,e=String(e),n||(e=e.toLowerCase(),r=r.toLowerCase());var i,o=e.length,a=Math.abs(t),u={};for(i=0;i=a)){if("1"===d&&1===a)continue;throw new Error(d+" is not a valid digit in base "+t+".")}}t=G(t);var c=[],l="-"===e[0];for(i=l?1:0;i"!==e[i]&&i=0;n--)i=i.add(e[n].times(o)),o=o.times(t);return r?i.negate():i}function X(e,t){if((t=i(t)).isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(t.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var n=!1;if(e.isNegative()&&t.isPositive()&&(n=!0,e=e.abs()),t.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:n};for(var o,s=[],a=e;a.isNegative()||a.compareAbs(t)>=0;){o=a.divmod(t),a=o.quotient;var u=o.remainder;u.isNegative()&&(u=t.minus(u).abs(),a=a.next()),s.push(u.toJSNumber())}return s.push(a.toJSNumber()),{value:s.reverse(),isNegative:n}}function Z(e,t,r){var n=X(e,t);return(n.isNegative?"-":"")+n.value.map((function(e){return function(e,t){return e<(t=t||s).length?t[e]:"<"+e+">"}(e,r)})).join("")}function J(e){if(d(+e)){var t=+e;if(t===g(t))return a?new l(BigInt(t)):new c(t);throw new Error("Invalid integer: "+e)}var n="-"===e[0];n&&(e=e.slice(1));var i=e.split(/e/i);if(i.length>2)throw new Error("Invalid integer: "+i.join("e"));if(2===i.length){var o=i[1];if("+"===o[0]&&(o=o.slice(1)),(o=+o)!==g(o)||!d(o))throw new Error("Invalid integer: "+o+" is not a valid exponent.");var s=i[0],u=s.indexOf(".");if(u>=0&&(o-=s.length-u-1,s=s.slice(0,u)+s.slice(u+1)),o<0)throw new Error("Cannot include negative exponent part for integers");e=s+=new Array(o+1).join("0")}if(!/^([0-9][0-9]*)$/.test(e))throw new Error("Invalid integer: "+e);if(a)return new l(BigInt(n?"-"+e:e));for(var h=[],f=e.length,m=r,y=f-m;f>0;)h.push(+e.slice(y,f)),(y-=m)<0&&(y=0),f-=m;return p(h),new BigInteger(h,n)}function G(e){return"number"==typeof e?function(e){if(a)return new l(BigInt(e));if(d(e)){if(e!==g(e))throw new Error(e+" is not an integer.");return new c(e)}return J(e.toString())}(e):"string"==typeof e?J(e):"bigint"==typeof e?new l(e):e}BigInteger.prototype.toArray=function(e){return X(this,e)},c.prototype.toArray=function(e){return X(this,e)},l.prototype.toArray=function(e){return X(this,e)},BigInteger.prototype.toString=function(t,r){if(t===e&&(t=10),10!==t)return Z(this,t,r);for(var n,i=this.value,o=i.length,s=String(i[--o]);--o>=0;)n=String(i[o]),s+="0000000".slice(n.length)+n;return(this.sign?"-":"")+s},c.prototype.toString=function(t,r){return t===e&&(t=10),10!=t?Z(this,t,r):String(this.value)},l.prototype.toString=c.prototype.toString,l.prototype.toJSON=BigInteger.prototype.toJSON=c.prototype.toJSON=function(){return this.toString()},BigInteger.prototype.valueOf=function(){return parseInt(this.toString(),10)},BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf,c.prototype.valueOf=function(){return this.value},c.prototype.toJSNumber=c.prototype.valueOf,l.prototype.valueOf=l.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var W=0;W<1e3;W++)u[W]=G(W),W>0&&(u[-W]=G(-W));return u.one=u[1],u.zero=u[0],u.minusOne=u[-1],u.max=z,u.min=V,u.gcd=$,u.lcm=function(e,t){return e=G(e).abs(),t=G(t).abs(),e.divide($(e,t)).multiply(t)},u.isInstance=function(e){return e instanceof BigInteger||e instanceof c||e instanceof l},u.randBetween=function(e,r,n){e=G(e),r=G(r);var i=n||Math.random,o=V(e,r),s=z(e,r).subtract(o).add(1);if(s.isSmall)return o.add(Math.floor(i()*s));for(var a=X(s,t).value,c=[],l=!0,d=0;d0||e===t?t:t-1}function b(e){for(var t,r,n=1,i=e.length,o=e[0]+"";nc^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;so[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function _(e,t,r,n){if(er||e!==u(e))throw Error(c+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return y(e.e/h)==t&&e.c[t]%2!=0}function M(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function j(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else tL?y.c=y.e=null:e.e=10;d/=10,c++);return void(c>L?y.c=y.e=null:(y.e=c,y.c=[e]))}g=String(e)}else{if(!s.test(g=String(e)))return i(y,g,p);y.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(c=g.indexOf("."))>-1&&(g=g.replace(".","")),(d=g.search(/e/i))>0?(c<0&&(c=d),c+=+g.slice(d+1),g=g.substring(0,d)):c<0&&(c=g.length)}else{if(_(t,2,z.length,"Base"),10==t&&V)return Z(y=new $(e),I+y.e+1,R);if(g=String(e),p="number"==typeof e){if(0*e!=0)return i(y,g,p,t);if(y.s=1/e<0?(g=g.slice(1),-1):1,$.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else y.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=z.slice(0,t),c=d=0,m=g.length;dc){c=m;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,d=-1,c=0;continue}return i(y,String(e),p,t)}p=!1,(c=(g=n(g,t,10,y.s)).indexOf("."))>-1?g=g.replace(".",""):c=g.length}for(d=0;48===g.charCodeAt(d);d++);for(m=g.length;48===g.charCodeAt(--m););if(g=g.slice(d,++m)){if(m-=d,p&&$.DEBUG&&m>15&&(e>f||e!==u(e)))throw Error(l+y.s*e);if((c=c-d-1)>L)y.c=y.e=null;else if(c=C)?M(u,s):j(u,s,"0");else if(o=(e=Z(new $(e),t,r)).e,a=(u=b(e.c)).length,1==n||2==n&&(t<=o||o<=N)){for(;aa){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-a)>0)for(o+1==a&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function K(e,t){for(var r,n=1,i=new $(e[0]);n=10;i/=10,n++);return(r=n+r*h-1)>L?e.c=e.e=null:r=10;c/=10,i++);if((o=t-i)<0)o+=h,s=t,m=(l=g[f=0])/y[i-s-1]%10|0;else if((f=a((o+1)/h))>=g.length){if(!n)break e;for(;g.length<=f;g.push(0));l=m=0,i=1,s=(o%=h)-h+1}else{for(l=c=g[f],i=1;c>=10;c/=10,i++);m=(s=(o%=h)-h+i)<0?0:l/y[i-s-1]%10|0}if(n=n||t<0||null!=g[f+1]||(s<0?l:l%y[i-s-1]),n=r<4?(m||n)&&(0==r||r==(e.s<0?3:2)):m>5||5==m&&(4==r||n||6==r&&(o>0?s>0?l/y[i-s]:0:g[f-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=y[(h-t%h)%h],e.e=-t||0):g[0]=e.e=0,e;if(0==o?(g.length=f,c=1,f--):(g.length=f+1,c=y[h-o],g[f]=s>0?u(l/y[i-s]%y[s])*c:0),n)for(;;){if(0==f){for(o=1,s=g[0];s>=10;s/=10,o++);for(s=g[0]+=c,c=1;s>=10;s/=10,c++);o!=c&&(e.e++,g[0]==d&&(g[0]=1));break}if(g[f]+=c,g[f]!=d)break;g[f--]=0,c=1}for(o=g.length;0===g[--o];g.pop());}e.e>L?e.c=e.e=null:e.e=C?M(t,r):j(t,r,"0"),e.s<0?"-"+t:t)}return $.clone=e,$.ROUND_UP=0,$.ROUND_DOWN=1,$.ROUND_CEIL=2,$.ROUND_FLOOR=3,$.ROUND_HALF_UP=4,$.ROUND_HALF_DOWN=5,$.ROUND_HALF_EVEN=6,$.ROUND_HALF_CEIL=7,$.ROUND_HALF_FLOOR=8,$.EUCLID=9,$.config=$.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(r=e[t],0,g,t),I=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(r=e[t],0,8,t),R=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(_(r[0],-g,0,t),_(r[1],0,g,t),N=r[0],C=r[1]):(_(r,-g,g,t),N=-(C=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)_(r[0],-g,-1,t),_(r[1],1,g,t),B=r[0],L=r[1];else{if(_(r,-g,g,t),!r)throw Error(c+t+" cannot be zero: "+r);B=-(L=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw F=!r,Error(c+"crypto unavailable");F=r}else F=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(r=e[t],0,9,t),D=r),e.hasOwnProperty(t="POW_PRECISION")&&(_(r=e[t],0,g,t),q=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);U=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);V="0123456789"==r.slice(0,10),z=r}}return{DECIMAL_PLACES:I,ROUNDING_MODE:R,EXPONENTIAL_AT:[N,C],RANGE:[B,L],CRYPTO:F,MODULO_MODE:D,POW_PRECISION:q,FORMAT:U,ALPHABET:z}},$.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!$.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%h)<1&&(t+=h),String(n[0]).length==t){for(t=0;t=d||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+e)},$.maximum=$.max=function(){return K(arguments,P.lt)},$.minimum=$.min=function(){return K(arguments,P.gt)},$.random=(o=9007199254740992,S=Math.random()*o&2097151?function(){return u(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,s=0,l=[],d=new $(k);if(null==e?e=I:_(e,0,g),i=a(e/h),F)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(l.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw F=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s=9e15?crypto.randomBytes(7).copy(t,s):(l.push(o%1e14),s+=7);s=i/7}if(!F)for(;s=10;o/=10,s++);sr-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var u,c,l,d,h,f,p,m,g=n.indexOf("."),y=I,v=R;for(g>=0&&(d=q,q=0,n=n.replace(".",""),f=(m=new $(i)).pow(n.length-g),q=d,m.c=t(j(b(f.c),f.e,"0"),10,o,e),m.e=m.c.length),l=d=(p=t(n,i,o,a?(u=z,e):(u=e,z))).length;0==p[--d];p.pop());if(!p[0])return u.charAt(0);if(g<0?--l:(f.c=p,f.e=l,f.s=s,p=(f=r(f,m,y,v,o)).c,h=f.r,l=f.e),g=p[c=l+y+1],d=o/2,h=h||c<0||null!=p[c+1],h=v<4?(null!=g||h)&&(0==v||v==(f.s<0?3:2)):g>d||g==d&&(4==v||h||6==v&&1&p[c-1]||v==(f.s<0?8:7)),c<1||!p[0])n=h?j(u.charAt(1),-y,u.charAt(0)):u.charAt(0);else{if(p.length=c,h)for(--o;++p[--c]>o;)p[c]=0,c||(++l,p=[1].concat(p));for(d=p.length;!p[--d];);for(g=0,n="";g<=d;n+=u.charAt(p[g++]));n=j(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,u=e.length,c=t%m,l=t/m|0;for(e=e.slice();u--;)a=((i=c*(o=e[u]%m)+(n=l*o+(s=e[u]/m|0)*c)%m*m+a)/r|0)+(n/m|0)+l*s,e[u]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(n,i,o,s,a){var c,l,f,p,m,g,b,v,_,w,M,j,S,A,E,x,O,T=n.s==i.s?1:-1,P=n.c,k=i.c;if(!(P&&P[0]&&k&&k[0]))return new $(n.s&&i.s&&(P?!k||P[0]!=k[0]:k)?P&&0==P[0]||!k?0*T:T/0:NaN);for(_=(v=new $(T)).c=[],T=o+(l=n.e-i.e)+1,a||(a=d,l=y(n.e/h)-y(i.e/h),T=T/h|0),f=0;k[f]==(P[f]||0);f++);if(k[f]>(P[f]||0)&&l--,T<0)_.push(1),p=!0;else{for(A=P.length,x=k.length,f=0,T+=2,(m=u(a/(k[0]+1)))>1&&(k=e(k,m,a),P=e(P,m,a),x=k.length,A=P.length),S=x,M=(w=P.slice(0,x)).length;M=a/2&&E++;do{if(m=0,(c=t(k,w,x,M))<0){if(j=w[0],x!=M&&(j=j*a+(w[1]||0)),(m=u(j/E))>1)for(m>=a&&(m=a-1),b=(g=e(k,m,a)).length,M=w.length;1==t(g,w,b,M);)m--,r(g,x=10;T/=10,f++);Z(v,o+(v.e=f+l*h-1)+1,s,p)}else v.e=l,v.r=+p;return v}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,x=/^\.([^.]+)$/,O=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(T,"");if(O.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(A,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(E,"$1").replace(x,"0.$1")),t!=o))return new $(o,i);if($.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},P.absoluteValue=P.abs=function(){var e=new $(this);return e.s<0&&(e.s=1),e},P.comparedTo=function(e,t){return v(this,new $(e,t))},P.decimalPlaces=P.dp=function(e,t){var r,n,i,o=this;if(null!=e)return _(e,0,g),null==t?t=R:_(t,0,8),Z(new $(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-y(this.e/h))*h,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},P.dividedBy=P.div=function(e,t){return r(this,new $(e,t),I,R)},P.dividedToIntegerBy=P.idiv=function(e,t){return r(this,new $(e,t),0,1)},P.exponentiatedBy=P.pow=function(e,t){var r,n,i,o,s,l,d,f,p=this;if((e=new $(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+J(e));if(null!=t&&(t=new $(t)),s=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return f=new $(Math.pow(+J(p),s?e.s*(2-w(e)):+J(e))),t?f.mod(t):f;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new $(NaN);(n=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return o=p.s<0&&w(e)?-0:0,p.e>-1&&(o=1/o),new $(l?1/o:o);q&&(o=a(q/h+2))}for(s?(r=new $(.5),l&&(e.s=1),d=w(e)):d=(i=Math.abs(+J(e)))%2,f=new $(k);;){if(d){if(!(f=f.times(p)).c)break;o?f.c.length>o&&(f.c.length=o):n&&(f=f.mod(t))}if(i){if(0===(i=u(i/2)))break;d=i%2}else if(Z(e=e.times(r),e.e+1,1),e.e>14)d=w(e);else{if(0===(i=+J(e)))break;d=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?f:(l&&(f=k.div(f)),t?f.mod(t):o?Z(f,q,R,undefined):f)},P.integerValue=function(e){var t=new $(this);return null==e?e=R:_(e,0,8),Z(t,t.e+1,e)},P.isEqualTo=P.eq=function(e,t){return 0===v(this,new $(e,t))},P.isFinite=function(){return!!this.c},P.isGreaterThan=P.gt=function(e,t){return v(this,new $(e,t))>0},P.isGreaterThanOrEqualTo=P.gte=function(e,t){return 1===(t=v(this,new $(e,t)))||0===t},P.isInteger=function(){return!!this.c&&y(this.e/h)>this.c.length-2},P.isLessThan=P.lt=function(e,t){return v(this,new $(e,t))<0},P.isLessThanOrEqualTo=P.lte=function(e,t){return-1===(t=v(this,new $(e,t)))||0===t},P.isNaN=function(){return!this.s},P.isNegative=function(){return this.s<0},P.isPositive=function(){return this.s>0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new $(e,t)).s,!a||!t)return new $(NaN);if(a!=t)return e.s=-t,s.plus(e);var u=s.e/h,c=e.e/h,l=s.c,f=e.c;if(!u||!c){if(!l||!f)return l?(e.s=-t,e):new $(f?s:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new $(l[0]?s:3==R?-0:0)}if(u=y(u),c=y(c),l=l.slice(),a=u-c){for((o=a<0)?(a=-a,i=l):(c=u,i=f),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=l.length)<(t=f.length))?a:t,a=t=0;t0)for(;t--;l[r++]=0);for(t=d-1;n>a;){if(l[--n]=0;){for(r=0,p=j[i]%_,g=j[i]/_|0,o=i+(s=u);o>i;)r=((c=p*(c=M[--s]%_)+(a=g*c+(l=M[s]/_|0)*p)%_*_+b[o]+r)/v|0)+(a/_|0)+g*l,b[o--]=c%v;b[o]=r}return r?++n:b.splice(0,1),X(e,b,n)},P.negated=function(){var e=new $(this);return e.s=-e.s||null,e},P.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new $(e,t)).s,!i||!t)return new $(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/h,s=e.e/h,a=n.c,u=e.c;if(!o||!s){if(!a||!u)return new $(i/0);if(!a[0]||!u[0])return u[0]?e:new $(a[0]?n:0*i)}if(o=y(o),s=y(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+u[t]+i)/d|0,a[t]=d===a[t]?0:a[t]%d;return i&&(a=[i].concat(a),++s),X(e,a,s)},P.precision=P.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return _(e,1,g),null==t?t=R:_(t,0,8),Z(new $(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*h+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},P.shiftedBy=function(e){return _(e,-9007199254740991,f),this.times("1e"+e)},P.squareRoot=P.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,u=s.s,c=s.e,l=I+4,d=new $("0.5");if(1!==u||!a||!a[0])return new $(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+J(s)))||u==1/0?(((t=b(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=y((c+1)/2)-(c<0||c%2),n=new $(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new $(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(o=n,n=d.times(o.plus(r(s,o,l,1))),b(o.c).slice(0,u)===(t=b(n.c)).slice(0,u)){if(n.e0&&m>0){for(o=m%a||a,d=p.substr(0,o);o0&&(d+=l+p.slice(o)),f&&(d="-"+d)}n=h?d+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):d}return(r.prefix||"")+n+(r.suffix||"")},P.toFraction=function(e){var t,n,i,o,s,a,u,l,d,f,m,g,y=this,v=y.c;if(null!=e&&(!(u=new $(e)).isInteger()&&(u.c||1!==u.s)||u.lt(k)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+J(u));if(!v)return new $(y);for(t=new $(k),d=n=new $(k),i=l=new $(k),g=b(v),s=t.e=g.length-y.e-1,t.c[0]=p[(a=s%h)<0?h+a:a],e=!e||u.comparedTo(t)>0?s>0?t:d:u,a=L,L=1/0,u=new $(g),l.c[0]=0;f=r(u,t,0,1),1!=(o=n.plus(f.times(i))).comparedTo(e);)n=i,i=o,d=l.plus(f.times(o=d)),l=o,t=u.minus(f.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),l=l.plus(o.times(d)),n=n.plus(o.times(i)),l.s=d.s=y.s,m=r(d,i,s*=2,R).minus(y).abs().comparedTo(r(l,n,s,R).minus(y).abs())<1?[d,i]:[l,n],L=a,m},P.toNumber=function(){return+J(this)},P.toPrecision=function(e,t){return null!=e&&_(e,1,g),H(this,e,t,2)},P.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=N||o>=C?M(b(r.c),o):j(b(r.c),o,"0"):10===e&&V?t=j(b((r=Z(new $(r),I+o+1,R)).c),r.e,"0"):(_(e,2,z.length,"Base"),t=n(j(b(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},P.valueOf=P.toJSON=function(){return J(this)},P._isBigNumber=!0,null!=t&&$.set(t),$}(),o.default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},"../../node_modules/bn.js/lib/bn.js":function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var Buffer;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{Buffer="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r("?2e65").Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=a(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(l).toString(e);r=(p=p.idivn(l)).isZero()?m+r:d[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},Buffer&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(Buffer,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],_=8191&v,w=v>>>13,M=0|s[4],j=8191&M,S=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,O=0|s[6],T=8191&O,P=O>>>13,k=0|s[7],I=8191&k,R=k>>>13,N=0|s[8],C=8191&N,B=N>>>13,L=0|s[9],F=8191&L,D=L>>>13,q=0|a[0],U=8191&q,z=q>>>13,V=0|a[1],$=8191&V,H=V>>>13,K=0|a[2],X=8191&K,Z=K>>>13,J=0|a[3],G=8191&J,W=J>>>13,Y=0|a[4],Q=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],de=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(h,U)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(m,U)|0,o=Math.imul(m,z);var ye=(c+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(b,U)|0,o=Math.imul(b,z),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var be=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var ve=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,z))+Math.imul(S,U)|0,o=Math.imul(S,z),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,W)|0;var _e=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(x,U)|0,o=Math.imul(x,z),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var we=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var Me=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(R,U)|0,o=Math.imul(R,z),n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var je=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,H)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Se=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(D,U)|0,o=Math.imul(D,z),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,H)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Ae=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,H))+Math.imul(D,$)|0,o=Math.imul(D,H),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,he)|0;var Ee=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,Z))+Math.imul(D,X)|0,o=Math.imul(D,Z),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,he)|0;var xe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,G),i=(i=Math.imul(F,W))+Math.imul(D,G)|0,o=Math.imul(D,W),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,he)|0;var Te=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(T,de)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,he)|0;var Pe=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,oe),i=(i=Math.imul(F,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(R,de)|0,o=o+Math.imul(R,he)|0;var ke=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,ce))+Math.imul(D,ue)|0,o=Math.imul(D,ce),n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,he)|0;var Ie=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,de),i=(i=Math.imul(F,he))+Math.imul(D,de)|0,o=Math.imul(D,he);var Re=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(c+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(D,pe)|0))<<13)|0;return c=((o=Math.imul(D,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=_e,u[5]=we,u[6]=Me,u[7]=je,u[8]=Se,u[9]=Ae,u[10]=Ee,u[11]=xe,u[12]=Oe,u[13]=Te,u[14]=Pe,u[15]=ke,u[16]=Ie,u[17]=Re,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=p),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function j(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(w,_),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new j;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},i(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/brorand/index.js":(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function n(e){Buffer.isBuffer(e)||(e=Buffer.from(e));for(var t=e.length/4|0,r=new Array(t),n=0;n>>24]^l[p>>>16&255]^d[m>>>8&255]^h[255&g]^t[y++],s=c[p>>>24]^l[m>>>16&255]^d[g>>>8&255]^h[255&f]^t[y++],a=c[m>>>24]^l[g>>>16&255]^d[f>>>8&255]^h[255&p]^t[y++],u=c[g>>>24]^l[f>>>16&255]^d[p>>>8&255]^h[255&m]^t[y++],f=o,p=s,m=a,g=u;return o=(n[f>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&g])^t[y++],s=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[g>>>8&255]<<8|n[255&f])^t[y++],a=(n[m>>>24]<<24|n[g>>>16&255]<<16|n[f>>>8&255]<<8|n[255&p])^t[y++],u=(n[g>>>24]<<24|n[f>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^t[y++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],a=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var c=a^a<<1^a<<2^a<<3^a<<4;c=c>>>8^255&c^99,r[s]=c,n[c]=s;var l=e[s],d=e[l],h=e[d],f=257*e[c]^16843008*c;i[0][s]=f<<24|f>>>8,i[1][s]=f<<16|f>>>16,i[2][s]=f<<8|f>>>24,i[3][s]=f,f=16843009*h^65537*d^257*l^16843008*s,o[0][c]=f<<24|f>>>8,o[1][c]=f<<16|f>>>16,o[2][c]=f<<8|f>>>24,o[3][c]=f,0===s?s=a=1:(s=l^e[e[e[h^l]]],a^=e[e[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function u(e){this._key=n(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],o=0;o>>24,u=a.SBOX[u>>>24]<<24|a.SBOX[u>>>16&255]<<16|a.SBOX[u>>>8&255]<<8|a.SBOX[255&u],u^=s[o/t|0]<<24):t>6&&o%t==4&&(u=a.SBOX[u>>>24]<<24|a.SBOX[u>>>16&255]<<16|a.SBOX[u>>>8&255]<<8|a.SBOX[255&u]),i[o]=i[o-t]^u}for(var c=[],l=0;l>>24]]^a.INV_SUB_MIX[1][a.SBOX[h>>>16&255]]^a.INV_SUB_MIX[2][a.SBOX[h>>>8&255]]^a.INV_SUB_MIX[3][a.SBOX[255&h]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},u.prototype.encryptBlockRaw=function(e){return o(e=n(e),this._keySchedule,a.SUB_MIX,a.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=Buffer.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},u.prototype.decryptBlock=function(e){var t=(e=n(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,a.INV_SUB_MIX,a.INV_SBOX,this._nRounds),i=Buffer.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},u.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},e.exports.AES=u},"../../node_modules/browserify-aes/authCipher.js":(e,t,r)=>{var n=r("../../node_modules/browserify-aes/aes.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/cipher-base/index.js"),o=r("../../node_modules/inherits/inherits_browser.js"),s=r("../../node_modules/browserify-aes/ghash.js"),a=r("../../node_modules/buffer-xor/index.js"),u=r("../../node_modules/browserify-aes/incr32.js");function c(e,t,r,o){i.call(this);var a=Buffer.alloc(4,0);this._cipher=new n.AES(t);var c=this._cipher.encryptBlock(a);this._ghash=new s(c),r=function(e,t,r){if(12===t.length)return e._finID=Buffer.concat([t,Buffer.from([0,0,0,1])]),Buffer.concat([t,Buffer.from([0,0,0,2])]);var n=new s(r),i=t.length,o=i%16;n.update(t),o&&(o=16-o,n.update(Buffer.alloc(o,0))),n.update(Buffer.alloc(8,0));var a=8*i,c=Buffer.alloc(8);c.writeUIntBE(a,0,8),n.update(c),e._finID=n.state;var l=Buffer.from(e._finID);return u(l),l}(this,r,c),this._prev=Buffer.from(r),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}o(c,i),c.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=Buffer.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},c.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=a(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i{var n=r("../../node_modules/browserify-aes/encrypter.js"),i=r("../../node_modules/browserify-aes/decrypter.js"),o=r("../../node_modules/browserify-aes/modes/list.json");t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},"../../node_modules/browserify-aes/decrypter.js":(e,t,r)=>{var n=r("../../node_modules/browserify-aes/authCipher.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/browserify-aes/modes/index.js"),o=r("../../node_modules/browserify-aes/streamCipher.js"),s=r("../../node_modules/cipher-base/index.js"),a=r("../../node_modules/browserify-aes/aes.js"),u=r("../../node_modules/evp_bytestokey/index.js");function c(e,t,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new a.AES(t),this._prev=Buffer.from(r),this._mode=e,this._autopadding=!0}function l(){this.cache=Buffer.allocUnsafe(0)}function d(e,t,r){var s=i[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=Buffer.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=Buffer.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new o(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new c(s.module,t,r)}r("../../node_modules/inherits/inherits_browser.js")(c,s),c.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return Buffer.concat(n)},c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=i[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(t,!1,r.key,r.iv);return d(e,n.key,n.iv)},t.createDecipheriv=d},"../../node_modules/browserify-aes/encrypter.js":(e,t,r)=>{var n=r("../../node_modules/browserify-aes/modes/index.js"),i=r("../../node_modules/browserify-aes/authCipher.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=r("../../node_modules/browserify-aes/streamCipher.js"),s=r("../../node_modules/cipher-base/index.js"),a=r("../../node_modules/browserify-aes/aes.js"),u=r("../../node_modules/evp_bytestokey/index.js");function c(e,t,r){s.call(this),this._cache=new d,this._cipher=new a.AES(t),this._prev=Buffer.from(r),this._mode=e,this._autopadding=!0}r("../../node_modules/inherits/inherits_browser.js")(c,s),c.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return Buffer.concat(n)};var l=Buffer.alloc(16,16);function d(){this.cache=Buffer.allocUnsafe(0)}function h(e,t,r){var s=n[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=Buffer.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=Buffer.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new o(s.module,t,r):"auth"===s.type?new i(s.module,t,r):new c(s.module,t,r)}c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=Buffer.concat([this.cache,e])},d.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=Buffer.allocUnsafe(e),r=-1;++r{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=Buffer.alloc(16,0);function i(e){var t=Buffer.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=Buffer.alloc(16,0),this.cache=Buffer.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=i(o)},o.prototype.update=function(e){var t;for(this.cache=Buffer.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(Buffer.concat([this.cache,n],16)),this.ghash(i([0,e,0,t])),this.state},e.exports=o},"../../node_modules/browserify-aes/incr32.js":e=>{e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},"../../node_modules/browserify-aes/modes/cbc.js":(e,t,r)=>{var n=r("../../node_modules/buffer-xor/index.js");t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},"../../node_modules/browserify-aes/modes/cfb.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/buffer-xor/index.js");function i(e,t,r){var i=t.length,o=n(t,e._cache);return e._cache=e._cache.slice(i),e._prev=Buffer.concat([e._prev,r?t:o]),o}t.encrypt=function(e,t,r){for(var n,o=Buffer.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=Buffer.allocUnsafe(0)),!(e._cache.length<=t.length)){o=Buffer.concat([o,i(e,t,r)]);break}n=e._cache.length,o=Buffer.concat([o,i(e,t.slice(0,n),r)]),t=t.slice(n)}return o}},"../../node_modules/browserify-aes/modes/cfb1.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function n(e,t,r){for(var n,o,s=-1,a=0;++s<8;)n=t&1<<7-s?128:0,a+=(128&(o=e._cipher.encryptBlock(e._prev)[0]^n))>>s%8,e._prev=i(e._prev,r?n:o);return a}function i(e,t){var r=e.length,n=-1,i=Buffer.allocUnsafe(e.length);for(e=Buffer.concat([e,Buffer.from([t])]);++n>7;return i}t.encrypt=function(e,t,r){for(var i=t.length,o=Buffer.allocUnsafe(i),s=-1;++s{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function n(e,t,r){var n=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=Buffer.concat([e._prev.slice(1),Buffer.from([r?t:n])]),n}t.encrypt=function(e,t,r){for(var i=t.length,o=Buffer.allocUnsafe(i),s=-1;++s{var n=r("../../node_modules/buffer-xor/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/browserify-aes/incr32.js");function o(e){var t=e._cipher.encryptBlockRaw(e._prev);return i(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),i=e._cache.length;e._cache=Buffer.concat([e._cache,Buffer.allocUnsafe(16*r)]);for(var s=0;s{t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},"../../node_modules/browserify-aes/modes/index.js":(e,t,r)=>{var n={ECB:r("../../node_modules/browserify-aes/modes/ecb.js"),CBC:r("../../node_modules/browserify-aes/modes/cbc.js"),CFB:r("../../node_modules/browserify-aes/modes/cfb.js"),CFB8:r("../../node_modules/browserify-aes/modes/cfb8.js"),CFB1:r("../../node_modules/browserify-aes/modes/cfb1.js"),OFB:r("../../node_modules/browserify-aes/modes/ofb.js"),CTR:r("../../node_modules/browserify-aes/modes/ctr.js"),GCM:r("../../node_modules/browserify-aes/modes/ctr.js")},i=r("../../node_modules/browserify-aes/modes/list.json");for(var o in i)i[o].module=n[i[o].mode];e.exports=i},"../../node_modules/browserify-aes/modes/ofb.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=r("../../node_modules/buffer-xor/index.js");function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(e,t){for(;e._cache.length{var n=r("../../node_modules/browserify-aes/aes.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/cipher-base/index.js");function o(e,t,r,o){i.call(this),this._cipher=new n.AES(t),this._prev=Buffer.from(r),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=o,this._mode=e}r("../../node_modules/inherits/inherits_browser.js")(o,i),o.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},o.prototype._final=function(){this._cipher.scrub()},e.exports=o},"../../node_modules/browserify-cipher/browser.js":(e,t,r)=>{var n=r("../../node_modules/browserify-des/index.js"),i=r("../../node_modules/browserify-aes/browser.js"),o=r("../../node_modules/browserify-aes/modes/index.js"),s=r("../../node_modules/browserify-des/modes.js"),a=r("../../node_modules/evp_bytestokey/index.js");function u(e,t,r){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,r);if(s[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function c(e,t,r){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,r);if(s[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,n=s[e].iv}var i=a(t,!1,r,n);return u(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,n=s[e].iv}var i=a(t,!1,r,n);return c(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=c,t.listCiphers=t.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},"../../node_modules/browserify-des/index.js":(e,t,r)=>{var n=r("../../node_modules/cipher-base/index.js"),i=r("../../node_modules/des.js/lib/des.js"),o=r("../../node_modules/inherits/inherits_browser.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function a(e){n.call(this);var t,r=e.mode.toLowerCase(),i=s[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;Buffer.isBuffer(o)||(o=Buffer.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=Buffer.concat([o,o.slice(0,8)]));var a=e.iv;Buffer.isBuffer(a)||(a=Buffer.from(a)),this._des=i.create({key:o,iv:a,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=a,o(a,n),a.prototype._update=function(e){return Buffer.from(this._des.update(e))},a.prototype._final=function(){return Buffer.from(this._des.final())}},"../../node_modules/browserify-des/modes.js":(e,t)=>{t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},"../../node_modules/browserify-rsa/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=r("../../node_modules/bn.js/lib/bn.js"),i=r("../../node_modules/randombytes/browser.js");function o(e){var t,r=e.modulus.byteLength();do{t=new n(i(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var r=function(e){var t=o(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),i=t.modulus.byteLength(),s=new n(e).mul(r.blinder).umod(t.modulus),a=s.toRed(n.mont(t.prime1)),u=s.toRed(n.mont(t.prime2)),c=t.coefficient,l=t.prime1,d=t.prime2,h=a.redPow(t.exponent1).fromRed(),f=u.redPow(t.exponent2).fromRed(),p=h.isub(f).imul(c).umod(l).imul(d);return f.iadd(p).imul(r.unblinder).umod(t.modulus).toArrayLike(Buffer,"be",i)}s.getr=o,e.exports=s},"../../node_modules/browserify-sign/algos.js":(e,t,r)=>{e.exports=r("../../node_modules/browserify-sign/browser/algorithms.json")},"../../node_modules/browserify-sign/browser/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/create-hash/browser.js"),i=r("../../node_modules/readable-stream/readable-browser.js"),o=r("../../node_modules/inherits/inherits_browser.js"),s=r("../../node_modules/browserify-sign/browser/sign.js"),a=r("../../node_modules/browserify-sign/browser/verify.js"),u=r("../../node_modules/browserify-sign/browser/algorithms.json");function c(e){i.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function l(e){i.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){return new c(e)}function h(e){return new l(e)}Object.keys(u).forEach((function(e){u[e].id=Buffer.from(u[e].id,"hex"),u[e.toLowerCase()]=u[e]})),o(c,i.Writable),c.prototype._write=function(e,t,r){this._hash.update(e),r()},c.prototype.update=function(e,t){return"string"==typeof e&&(e=Buffer.from(e,t)),this._hash.update(e),this},c.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),n=s(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},o(l,i.Writable),l.prototype._write=function(e,t,r){this._hash.update(e),r()},l.prototype.update=function(e,t){return"string"==typeof e&&(e=Buffer.from(e,t)),this._hash.update(e),this},l.prototype.verify=function(e,t,r){"string"==typeof t&&(t=Buffer.from(t,r)),this.end();var n=this._hash.digest();return a(t,n,e,this._signType,this._tag)},e.exports={Sign:d,Verify:h,createSign:d,createVerify:h}},"../../node_modules/browserify-sign/browser/sign.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/create-hmac/browser.js"),i=r("../../node_modules/browserify-rsa/index.js"),o=r("../../node_modules/elliptic/lib/elliptic.js").ec,s=r("../../node_modules/bn.js/lib/bn.js"),a=r("../../node_modules/parse-asn1/index.js"),u=r("../../node_modules/browserify-sign/browser/curves.json");function c(e,t,r,i){if((e=Buffer.from(e.toArray())).length0&&r.ishrn(n),r}function d(e,t,r){var i,o;do{for(i=Buffer.alloc(0);8*i.length{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/bn.js/lib/bn.js"),i=r("../../node_modules/elliptic/lib/elliptic.js").ec,o=r("../../node_modules/parse-asn1/index.js"),s=r("../../node_modules/browserify-sign/browser/curves.json");function a(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,t,r,u,c){var l=o(r);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),a=r.data.subjectPrivateKey.data;return o.verify(t,e,a)}(e,t,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,s=r.data.q,u=r.data.g,c=r.data.pub_key,l=o.signature.decode(e,"der"),d=l.s,h=l.r;a(d,s),a(h,s);var f=n.mont(i),p=d.invm(s),m=u.toRed(f).redPow(new n(t).mul(p).mod(s)).fromRed().mul(c.toRed(f).redPow(h.mul(p).mod(s)).fromRed()).mod(i).mod(s);return 0===m.cmp(h)}(e,t,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");t=Buffer.concat([c,t]);for(var d=l.modulus.byteLength(),h=[1],f=0;t.length+h.length+2{var Buffer=r("../../node_modules/buffer/index.js").Buffer;e.exports=function(e,t){for(var r=Math.min(e.length,t.length),n=new Buffer(r),i=0;i{"use strict"; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */const n=r("../../node_modules/base64-js/index.js"),i=r("../../node_modules/ieee754/index.js"),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=Buffer,t.SlowBuffer=function(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|p(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);const i=function(e){if(Buffer.isBuffer(e)){const t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||J(e.length)?a(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return c(e),a(e<0?0:0|f(e))}function d(e){const t=e.length<0?0:0|f(e.length),r=a(t);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function p(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(Buffer.isBuffer(t)||(t=Buffer.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!Buffer.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},Buffer.byteLength=p,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},o&&(Buffer.prototype[o]=Buffer.prototype.inspect),Buffer.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return M(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const E=4096;function x(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,i,o){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,r,n,i){U(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function N(e,t,r,n,i){U(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function C(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,o){return t=+t,r>>>=0,o||C(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,o){return t=+t,r>>>=0,o||C(e,0,r,8),i.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readBigUInt64LE=W((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||k(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readBigInt64LE=W((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||k(e,4,this.length),i.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),i.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),i.read(this,e,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){I(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!n){I(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigUInt64LE=W((function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeBigUInt64BE=W((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);I(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);I(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeBigInt64LE=W((function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeBigInt64BE=W((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function U(e,t,r,n,i,o){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function z(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const $=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const G=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function W(e){return"undefined"==typeof BigInt?Y:e}function Y(){throw new Error("BigInt not supported")}},"../../node_modules/call-bind/callBound.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/get-intrinsic/index.js"),i=r("../../node_modules/call-bind/index.js"),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},"../../node_modules/call-bind/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/function-bind/index.js"),i=r("../../node_modules/get-intrinsic/index.js"),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=a(n,s,arguments);u&&c&&(u(t,"length").configurable&&c(t,"length",{value:1+l(0,e.length-(arguments.length-1))}));return t};var d=function(){return a(n,o,arguments)};c?c(e.exports,"apply",{value:d}):e.exports.apply=d},"../../node_modules/cipher-base/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/stream-browserify/index.js").Transform,i=r("../../node_modules/string_decoder/lib/string_decoder.js").s;function o(e){n.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r("../../node_modules/inherits/inherits_browser.js")(o,n),o.prototype.update=function(e,t,r){"string"==typeof e&&(e=Buffer.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},o.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},o.prototype._finalOrDigest=function(e){var t=this.__final()||Buffer.alloc(0);return e&&(t=this._toString(t,e,!0)),t},o.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=o},"../../node_modules/create-ecdh/browser.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=r("../../node_modules/elliptic/lib/elliptic.js"),i=r("../../node_modules/create-ecdh/node_modules/bn.js/lib/bn.js");e.exports=function(e){return new s(e)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(e){this.curveType=o[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function a(e,t,r){Array.isArray(e)||(e=e.toArray());var n=new Buffer(e);if(r&&n.length=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=a(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],_=8191&v,w=v>>>13,M=0|s[4],j=8191&M,S=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,O=0|s[6],T=8191&O,P=O>>>13,k=0|s[7],I=8191&k,R=k>>>13,N=0|s[8],C=8191&N,B=N>>>13,L=0|s[9],F=8191&L,D=L>>>13,q=0|a[0],U=8191&q,z=q>>>13,V=0|a[1],$=8191&V,H=V>>>13,K=0|a[2],X=8191&K,Z=K>>>13,J=0|a[3],G=8191&J,W=J>>>13,Y=0|a[4],Q=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],de=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(h,U)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(m,U)|0,o=Math.imul(m,z);var ye=(c+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(b,U)|0,o=Math.imul(b,z),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var be=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var ve=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,z))+Math.imul(S,U)|0,o=Math.imul(S,z),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,W)|0;var _e=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(x,U)|0,o=Math.imul(x,z),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var we=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var Me=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(R,U)|0,o=Math.imul(R,z),n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var je=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,H)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Se=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(D,U)|0,o=Math.imul(D,z),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,H)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Ae=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,H))+Math.imul(D,$)|0,o=Math.imul(D,H),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,he)|0;var Ee=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,Z))+Math.imul(D,X)|0,o=Math.imul(D,Z),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,he)|0;var xe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,G),i=(i=Math.imul(F,W))+Math.imul(D,G)|0,o=Math.imul(D,W),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,he)|0;var Te=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(T,de)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,he)|0;var Pe=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,oe),i=(i=Math.imul(F,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(R,de)|0,o=o+Math.imul(R,he)|0;var ke=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,ce))+Math.imul(D,ue)|0,o=Math.imul(D,ce),n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,he)|0;var Ie=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,de),i=(i=Math.imul(F,he))+Math.imul(D,de)|0,o=Math.imul(D,he);var Re=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(c+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(D,pe)|0))<<13)|0;return c=((o=Math.imul(D,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=_e,u[5]=we,u[6]=Me,u[7]=je,u[8]=Se,u[9]=Ae,u[10]=Ee,u[11]=xe,u[12]=Oe,u[13]=Te,u[14]=Pe,u[15]=ke,u[16]=Ie,u[17]=Re,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new M(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function j(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new j(e)},i(j,M),j.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},j.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},j.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},j.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},j.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/create-hash/browser.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/md5.js/index.js"),o=r("../../node_modules/ripemd160/index.js"),s=r("../../node_modules/sha.js/index.js"),a=r("../../node_modules/cipher-base/index.js");function u(e){a.call(this,"digest"),this._hash=e}n(u,a),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(s(e))}},"../../node_modules/create-hash/md5.js":(e,t,r)=>{var n=r("../../node_modules/md5.js/index.js");e.exports=function(e){return(new n).update(e).digest()}},"../../node_modules/create-hmac/browser.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/create-hmac/legacy.js"),o=r("../../node_modules/cipher-base/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=r("../../node_modules/create-hash/md5.js"),a=r("../../node_modules/ripemd160/index.js"),u=r("../../node_modules/sha.js/index.js"),c=Buffer.alloc(128);function l(e,t){o.call(this,"digest"),"string"==typeof t&&(t=Buffer.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new a:u(e)).update(t).digest():t.length{"use strict";var n=r("../../node_modules/inherits/inherits_browser.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,i=r("../../node_modules/cipher-base/index.js"),o=Buffer.alloc(128),s=64;function a(e,t){i.call(this,"digest"),"string"==typeof t&&(t=Buffer.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length{"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r("../../node_modules/randombytes/browser.js"),t.createHash=t.Hash=r("../../node_modules/create-hash/browser.js"),t.createHmac=t.Hmac=r("../../node_modules/create-hmac/browser.js");var n=r("../../node_modules/browserify-sign/algos.js"),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var s=r("../../node_modules/pbkdf2/browser.js");t.pbkdf2=s.pbkdf2,t.pbkdf2Sync=s.pbkdf2Sync;var a=r("../../node_modules/browserify-cipher/browser.js");t.Cipher=a.Cipher,t.createCipher=a.createCipher,t.Cipheriv=a.Cipheriv,t.createCipheriv=a.createCipheriv,t.Decipher=a.Decipher,t.createDecipher=a.createDecipher,t.Decipheriv=a.Decipheriv,t.createDecipheriv=a.createDecipheriv,t.getCiphers=a.getCiphers,t.listCiphers=a.listCiphers;var u=r("../../node_modules/diffie-hellman/browser.js");t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var c=r("../../node_modules/browserify-sign/browser/index.js");t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=r("../../node_modules/create-ecdh/browser.js");var l=r("../../node_modules/public-encrypt/browser.js");t.publicEncrypt=l.publicEncrypt,t.privateEncrypt=l.privateEncrypt,t.publicDecrypt=l.publicDecrypt,t.privateDecrypt=l.privateDecrypt;var d=r("../../node_modules/randomfill/browser.js");t.randomFill=d.randomFill,t.randomFillSync=d.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},"../../node_modules/decimal.js/decimal.js":function(e,t,r){var n;!function(i){"use strict"; +/*! + * decimal.js v10.4.3 + * An arbitrary-precision Decimal type for JavaScript. + * https://github.com/MikeMcl/decimal.js + * Copyright (c) 2022 Michael Mclaughlin + * MIT Licence + */var o,s,a,u=9e15,c=1e9,l="0123456789abcdef",d="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",h="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",f={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-u,maxE:u,crypto:!1},p=!0,m="[DecimalError] ",g=m+"Invalid argument: ",y=m+"Precision limit exceeded",b=m+"crypto unavailable",v="[object Decimal]",_=Math.floor,w=Math.pow,M=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,j=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,S=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,A=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,E=1e7,x=7,O=d.length-1,T=h.length-1,P={toStringTag:v};function k(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(g+e)}function R(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=x,i=0):(i=Math.ceil((t+1)/x),t%=x),o=w(10,x-t),a=e[i]%o|0,null==n?t<3?(0==t?a=a/100|0:1==t&&(a=a/10|0),s=r<4&&99999==a||r>3&&49999==a||5e4==a||0==a):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==w(10,t-2)-1||(a==o/2||0==a)&&0==(e[i+1]/o/100|0):t<4?(0==t?a=a/1e3|0:1==t?a=a/100|0:2==t&&(a=a/10|0),s=(n||r<4)&&9999==a||!n&&r>3&&4999==a):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==w(10,t-3)-1,s}function N(e,t,r){for(var n,i,o=[0],s=0,a=e.length;sr-1&&(void 0===o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}P.absoluteValue=P.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),B(e)},P.ceil=function(){return B(new this.constructor(this),this.e+1,2)},P.clampedTo=P.clamp=function(e,t){var r=this,n=r.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(g+t);return r.cmp(e)<0?e:r.cmp(t)>0?t:new n(r)},P.comparedTo=P.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,u=o.s,c=e.s;if(!s||!a)return u&&c?u!==c?u:s===a?0:!s^u<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?u:a[0]?-c:0;if(u!==c)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(t=0,r=(n=s.length)<(i=a.length)?n:i;ta[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},P.cosine=P.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+x,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?i=(1/Y(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10");e.precision+=r,t=W(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}(n,Q(n,r)),n.precision=e,n.rounding=t,B(2==a||3==a?r.neg():r,e,t,!0)):new n(1):new n(NaN)},P.cubeRoot=P.cbrt=function(){var e,t,r,n,i,o,s,a,u,c,l=this,d=l.constructor;if(!l.isFinite()||l.isZero())return new d(l);for(p=!1,(o=l.s*w(l.s*l,1/3))&&Math.abs(o)!=1/0?n=new d(o.toString()):(r=k(l.d),(o=((e=l.e)-r.length+1)%3)&&(r+=1==o||-2==o?"0":"00"),o=w(r,1/3),e=_((e+1)/3)-(e%3==(e<0?-1:2)),(n=new d(r=o==1/0?"5e"+e:(r=o.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=l.s),s=(e=d.precision)+3;;)if(c=(u=(a=n).times(a).times(a)).plus(l),n=C(c.plus(l).times(a),c.plus(u),s+2,1),k(a.d).slice(0,s)===(r=k(n.d)).slice(0,s)){if("9999"!=(r=r.slice(s-3,s+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(B(n,e+1,1),t=!n.times(n).times(n).eq(l));break}if(!i&&(B(a,e+1,0),a.times(a).times(a).eq(l))){n=a;break}s+=4,i=1}return p=!0,B(n,e,d.rounding,t)},P.decimalPlaces=P.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=((e=t.length-1)-_(this.e/x))*x,e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},P.dividedBy=P.div=function(e){return C(this,new this.constructor(e))},P.dividedToIntegerBy=P.divToInt=function(e){var t=this.constructor;return B(C(this,new t(e),0,1,1),t.precision,t.rounding)},P.equals=P.eq=function(e){return 0===this.cmp(e)},P.floor=function(){return B(new this.constructor(this),this.e+1,3)},P.greaterThan=P.gt=function(e){return this.cmp(e)>0},P.greaterThanOrEqualTo=P.gte=function(e){var t=this.cmp(e);return 1==t||0===t},P.hyperbolicCosine=P.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?t=(1/Y(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=W(s,1,o.times(t),new s(1),!0);for(var u,c=e,l=new s(8);c--;)u=o.times(o),o=a.minus(u.times(l.minus(u.times(l))));return B(o,s.precision=r,s.rounding=n,!0)},P.hyperbolicSine=P.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=W(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=W(o,2,i=i.times(1/Y(5,e)),i,!0);for(var s,a=new o(5),u=new o(16),c=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(c))))}return o.precision=t,o.rounding=r,B(i,t,r,!0)},P.hyperbolicTangent=P.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,C(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},P.inverseCosine=P.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return-1!==n?0===n?t.isNeg()?q(r,i,o):new r(0):new r(NaN):t.isZero()?q(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=q(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))},P.inverseHyperbolicCosine=P.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,p=!1,r=r.times(r).minus(1).sqrt().plus(r),p=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},P.inverseHyperbolicSine=P.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,p=!1,r=r.times(r).plus(1).sqrt().plus(r),p=!0,n.precision=e,n.rounding=t,r.ln())},P.inverseHyperbolicTangent=P.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?B(new o(i),e,t,!0):(o.precision=r=n-i.e,i=C(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},P.inverseSine=P.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,-1!==t?0===t?((e=q(o,r+4,n).times(.5)).s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))},P.inverseTangent=P.atan=function(){var e,t,r,n,i,o,s,a,u,c=this,l=c.constructor,d=l.precision,h=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&d+4<=T)return(s=q(l,d+4,h).times(.25)).s=c.s,s}else{if(!c.s)return new l(NaN);if(d+4<=T)return(s=q(l,d+4,h).times(.5)).s=c.s,s}for(l.precision=a=d+10,l.rounding=1,e=r=Math.min(28,a/x+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(p=!1,t=Math.ceil(a/x),n=1,u=c.times(c),s=new l(c),i=c;-1!==e;)if(i=i.times(u),o=s.minus(i.div(n+=2)),i=i.times(u),void 0!==(s=o.plus(i.div(n+=2))).d[t])for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isPositive=P.isPos=function(){return this.s>0},P.isZero=function(){return!!this.d&&0===this.d[0]},P.lessThan=P.lt=function(e){return this.cmp(e)<0},P.lessThanOrEqualTo=P.lte=function(e){return this.cmp(e)<1},P.logarithm=P.log=function(e){var t,r,n,i,o,s,a,u,c=this,l=c.constructor,d=l.precision,h=l.rounding;if(null==e)e=new l(10),t=!0;else{if(r=(e=new l(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new l(r&&!r[0]?-1/0:1!=c.s?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10==0;)i/=10;o=1!==i}if(p=!1,s=X(c,a=d+5),n=t?D(l,a+10):X(e,a),R((u=C(s,n,a,1)).d,i=d,h))do{if(s=X(c,a+=10),n=t?D(l,a+10):X(e,a),u=C(s,n,a,1),!o){+k(u.d).slice(i+1,i+15)+1==1e14&&(u=B(u,d+1,0));break}}while(R(u.d,i+=10,h));return p=!0,B(u,d,h)},P.minus=P.sub=function(e){var t,r,n,i,o,s,a,u,c,l,d,h,f=this,m=f.constructor;if(e=new m(e),!f.d||!e.d)return f.s&&e.s?f.d?e.s=-e.s:e=new m(e.d||f.s!==e.s?f:NaN):e=new m(NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(c=f.d,h=e.d,a=m.precision,u=m.rounding,!c[0]||!h[0]){if(h[0])e.s=-e.s;else{if(!c[0])return new m(3===u?-0:0);e=new m(f)}return p?B(e,a,u):e}if(r=_(e.e/x),l=_(f.e/x),c=c.slice(),o=l-r){for((d=o<0)?(t=c,o=-o,s=h.length):(t=h,r=l,s=c.length),o>(n=Math.max(Math.ceil(a/x),s)+2)&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for((d=(n=c.length)<(s=h.length))&&(s=n),n=0;n0;--n)c[s++]=0;for(n=h.length;n>o;){if(c[--n](s=(o=Math.ceil(a/x))>s?o+1:s+1)&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((s=c.length)-(i=l.length)<0&&(i=s,r=l,l=c,c=r),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/E|0,c[i]%=E;for(t&&(c.unshift(t),++n),s=c.length;0==c[--s];)c.pop();return e.d=c,e.e=F(c,n),p?B(e,a,u):e},P.precision=P.sd=function(e){var t,r=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(g+e);return r.d?(t=U(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},P.round=function(){var e=this,t=e.constructor;return B(new t(e),e.e+1,t.rounding)},P.sine=P.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+x,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:W(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=t.times(1/Y(5,r)),t=W(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}(n,Q(n,r)),n.precision=e,n.rounding=t,B(a>2?r.neg():r,e,t,!0)):new n(NaN)},P.squareRoot=P.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,u=s.e,c=s.s,l=s.constructor;if(1!==c||!a||!a[0])return new l(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);for(p=!1,0==(c=Math.sqrt(+s))||c==1/0?(((t=k(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=_((u+1)/2)-(u<0||u%2),n=new l(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new l(c.toString()),r=(u=l.precision)+3;;)if(n=(o=n).plus(C(s,o,r+2,1)).times(.5),k(o.d).slice(0,r)===(t=k(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(B(n,u+1,1),e=!n.times(n).eq(s));break}if(!i&&(B(o,u+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}return p=!0,B(n,u,l.rounding,e)},P.tangent=P.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=C(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,B(2==a||4==a?r.neg():r,e,t,!0)):new n(NaN)},P.times=P.mul=function(e){var t,r,n,i,o,s,a,u,c,l=this,d=l.constructor,h=l.d,f=(e=new d(e)).d;if(e.s*=l.s,!(h&&h[0]&&f&&f[0]))return new d(!e.s||h&&!h[0]&&!f||f&&!f[0]&&!h?NaN:h&&f?0*e.s:e.s/0);for(r=_(l.e/x)+_(e.e/x),(u=h.length)<(c=f.length)&&(o=h,h=f,f=o,s=u,u=c,c=s),o=[],n=s=u+c;n--;)o.push(0);for(n=c;--n>=0;){for(t=0,i=u+n;i>n;)a=o[i]+f[n]*h[i-n-1]+t,o[i--]=a%E|0,t=a/E|0;o[i]=(o[i]+t)%E|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=F(o,r),p?B(e,d.precision,d.rounding):e},P.toBinary=function(e,t){return ee(this,2,e,t)},P.toDecimalPlaces=P.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(I(e,0,c),void 0===t?t=n.rounding:I(t,0,8),B(r,e+r.e+1,t))},P.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=L(n,!0):(I(e,0,c),void 0===t?t=i.rounding:I(t,0,8),r=L(n=B(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},P.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return void 0===e?r=L(i):(I(e,0,c),void 0===t?t=o.rounding:I(t,0,8),r=L(n=B(new o(i),e+i.e+1,t),!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},P.toFraction=function(e){var t,r,n,i,o,s,a,u,c,l,d,h,f=this,m=f.d,y=f.constructor;if(!m)return new y(f);if(c=r=new y(1),n=u=new y(0),s=(o=(t=new y(n)).e=U(m)-f.e-1)%x,t.d[0]=w(10,s<0?x+s:s),null==e)e=o>0?t:c;else{if(!(a=new y(e)).isInt()||a.lt(c))throw Error(g+a);e=a.gt(t)?o>0?t:c:a}for(p=!1,a=new y(k(m)),l=y.precision,y.precision=o=m.length*x*2;d=C(a,t,0,1,1),1!=(i=r.plus(d.times(n))).cmp(e);)r=n,n=i,i=c,c=u.plus(d.times(i)),u=i,i=t,t=a.minus(d.times(i)),a=i;return i=C(e.minus(r),n,0,1,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=f.s,h=C(c,n,o,1).minus(f).abs().cmp(C(u,r,o,1).minus(f).abs())<1?[c,n]:[u,r],y.precision=l,p=!0,h},P.toHexadecimal=P.toHex=function(e,t){return ee(this,16,e,t)},P.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:I(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(p=!1,r=C(r,e,0,t,1).times(e),p=!0,B(r)):(e.s=r.s,r=e),r},P.toNumber=function(){return+this},P.toOctal=function(e,t){return ee(this,8,e,t)},P.toPower=P.pow=function(e){var t,r,n,i,o,s,a=this,u=a.constructor,c=+(e=new u(e));if(!(a.d&&e.d&&a.d[0]&&e.d[0]))return new u(w(+a,c));if((a=new u(a)).eq(1))return a;if(n=u.precision,o=u.rounding,e.eq(1))return B(a,n,o);if((t=_(e.e/x))>=e.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=V(u,a,r,n),e.s<0?new u(1).div(i):B(i,n,o);if((s=a.s)<0){if(tu.maxE+1||t0?s/0:0):(p=!1,u.rounding=a.s=1,r=Math.min(12,(t+"").length),(i=K(e.times(X(a,n+r)),n)).d&&R((i=B(i,n+5,1)).d,n,o)&&(t=n+10,+k((i=B(K(e.times(X(a,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=B(i,n+1,0))),i.s=s,p=!0,u.rounding=o,B(i,n,o))},P.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=L(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(I(e,1,c),void 0===t?t=i.rounding:I(t,0,8),r=L(n=B(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},P.toSignificantDigits=P.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(I(e,1,c),void 0===t?t=r.rounding:I(t,0,8)),B(new r(this),e,t)},P.toString=function(){var e=this,t=e.constructor,r=L(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},P.truncated=P.trunc=function(){return B(new this.constructor(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var e=this,t=e.constructor,r=L(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};var C=function(){function e(e,t,r){var n,i=0,o=e.length;for(e=e.slice();o--;)n=e[o]*t+i,e[o]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;)e.shift()}return function(n,i,o,a,u,c){var l,d,h,f,p,m,g,y,b,v,w,M,j,S,A,O,T,P,k,I,R=n.constructor,N=n.s==i.s?1:-1,C=n.d,L=i.d;if(!(C&&C[0]&&L&&L[0]))return new R(n.s&&i.s&&(C?!L||C[0]!=L[0]:L)?C&&0==C[0]||!L?0*N:N/0:NaN);for(c?(p=1,d=n.e-i.e):(c=E,p=x,d=_(n.e/p)-_(i.e/p)),k=L.length,T=C.length,v=(b=new R(N)).d=[],h=0;L[h]==(C[h]||0);h++);if(L[h]>(C[h]||0)&&d--,null==o?(S=o=R.precision,a=R.rounding):S=u?o+(n.e-i.e)+1:o,S<0)v.push(1),m=!0;else{if(S=S/p+2|0,h=0,1==k){for(f=0,L=L[0],S++;(h1&&(L=e(L,f,c),C=e(C,f,c),k=L.length,T=C.length),O=k,M=(w=C.slice(0,k)).length;M=c/2&&++P;do{f=0,(l=t(L,w,k,M))<0?(j=w[0],k!=M&&(j=j*c+(w[1]||0)),(f=j/P|0)>1?(f>=c&&(f=c-1),1==(l=t(g=e(L,f,c),w,y=g.length,M=w.length))&&(f--,r(g,k=10;f/=10)h++;b.e=h+d*p-1,B(b,u?o+b.e+1:o,a,m)}return b}}();function B(e,t,r,n){var i,o,s,a,u,c,l,d,h,f=e.constructor;e:if(null!=t){if(!(d=e.d))return e;for(i=1,a=d[0];a>=10;a/=10)i++;if((o=t-i)<0)o+=x,s=t,u=(l=d[h=0])/w(10,i-s-1)%10|0;else if((h=Math.ceil((o+1)/x))>=(a=d.length)){if(!n)break e;for(;a++<=h;)d.push(0);l=u=0,i=1,s=(o%=x)-x+1}else{for(l=a=d[h],i=1;a>=10;a/=10)i++;u=(s=(o%=x)-x+i)<0?0:l/w(10,i-s-1)%10|0}if(n=n||t<0||void 0!==d[h+1]||(s<0?l:l%w(10,i-s-1)),c=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(o>0?s>0?l/w(10,i-s):0:d[h-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,c?(t-=e.e+1,d[0]=w(10,(x-t%x)%x),e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=h,a=1,h--):(d.length=h+1,a=w(10,x-o),d[h]=s>0?(l/w(10,i-s)%w(10,s)|0)*a:0),c)for(;;){if(0==h){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,d[0]==E&&(d[0]=1));break}if(d[h]+=a,d[h]!=E)break;d[h--]=0,a=1}for(o=d.length;0===d[--o];)d.pop()}return p&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+z(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+z(-i-1)+o,r&&(n=r-s)>0&&(o+=z(n))):i>=s?(o+=z(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+z(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=z(n))),o}function F(e,t){var r=e[0];for(t*=x;r>=10;r/=10)t++;return t}function D(e,t,r){if(t>O)throw p=!0,r&&(e.precision=r),Error(y);return B(new e(d),t,1,!0)}function q(e,t,r){if(t>T)throw Error(y);return B(new e(h),t,r,!0)}function U(e){var t=e.length-1,r=t*x+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function z(e){for(var t="";e--;)t+="0";return t}function V(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/x+4);for(p=!1;;){if(r%2&&te((o=o.times(t)).d,s)&&(i=!0),0===(r=_(r/2))){r=o.d.length-1,i&&0===o.d[r]&&++o.d[r];break}te((t=t.times(t)).d,s)}return p=!0,o}function $(e){return 1&e.d[e.d.length-1]}function H(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(p=!1,u=m):u=t,a=new h(.03125);e.e>-2;)e=e.times(a),d+=5;for(u+=n=Math.log(w(2,d))/Math.LN10*2+5|0,r=o=s=new h(1),h.precision=u;;){if(o=B(o.times(e),u,1),r=r.times(++l),k((a=s.plus(C(o,r,u,1))).d).slice(0,u)===k(s.d).slice(0,u)){for(i=d;i--;)s=B(s.times(s),u,1);if(null!=t)return h.precision=m,s;if(!(c<3&&R(s.d,u-n,f,c)))return B(s,h.precision=m,f,p=!0);h.precision=u+=10,r=o=a=new h(1),l=0,c++}s=a}}function X(e,t){var r,n,i,o,s,a,u,c,l,d,h,f=1,m=e,g=m.d,y=m.constructor,b=y.rounding,v=y.precision;if(m.s<0||!g||!g[0]||!m.e&&1==g[0]&&1==g.length)return new y(g&&!g[0]?-1/0:1!=m.s?NaN:g?0:m);if(null==t?(p=!1,l=v):l=t,y.precision=l+=10,n=(r=k(g)).charAt(0),!(Math.abs(o=m.e)<15e14))return c=D(y,l+2,v).times(o+""),m=X(new y(n+"."+r.slice(1)),l-10).plus(c),y.precision=v,null==t?B(m,v,b,p=!0):m;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=k((m=m.times(e)).d)).charAt(0),f++;for(o=m.e,n>1?(m=new y("0."+r),o++):m=new y(n+"."+r.slice(1)),d=m,u=s=m=C(m.minus(1),m.plus(1),l,1),h=B(m.times(m),l,1),i=3;;){if(s=B(s.times(h),l,1),k((c=u.plus(C(s,new y(i),l,1))).d).slice(0,l)===k(u.d).slice(0,l)){if(u=u.times(2),0!==o&&(u=u.plus(D(y,l+2,v).times(o+""))),u=C(u,new y(f),l,1),null!=t)return y.precision=v,u;if(!R(u.d,l-10,b,a))return B(u,y.precision=v,b,p=!0);y.precision=l+=10,c=s=m=C(d.minus(1),d.plus(1),l,1),h=B(m.times(m),l,1),i=a=1}u=c,i+=2}}function Z(e){return String(e.s*e.s/0)}function J(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%x,r<0&&(n+=x),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),A.test(t))return J(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(j.test(t))r=16,t=t.toLowerCase();else if(M.test(t))r=2;else{if(!S.test(t))throw Error(g+t);r=8}for((s=t.search(/p/i))>0?(c=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),a=(s=t.indexOf("."))>=0,n=e.constructor,a&&(s=(u=(t=t.replace(".","")).length)-s,i=V(n,new n(r),s,2*s)),s=d=(l=N(t,r,E)).length-1;0===l[s];--s)l.pop();return s<0?new n(0*e.s):(e.e=F(l,d),e.d=l,p=!1,a&&(e=C(e,i,4*u)),c&&(e=e.times(Math.abs(c)<54?w(2,c):o.pow(2,c))),p=!0,e)}function W(e,t,r,n,i){var o,s,a,u,c=e.precision,l=Math.ceil(c/x);for(p=!1,u=r.times(r),a=new e(n);;){if(s=C(a.times(u),new e(t++*t++),c,1),a=i?n.plus(s):n.minus(s),n=C(s.times(u),new e(t++*t++),c,1),void 0!==(s=a.plus(n)).d[l]){for(o=l;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=n,n=s,s=o}return p=!0,s.d.length=l+1,s}function Y(e,t){for(var r=e;--t;)r*=e;return r}function Q(e,t){var r,n=t.s<0,i=q(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return a=n?4:1,t;if((r=t.divToInt(i)).isZero())a=n?3:2;else{if((t=t.minus(r.times(i))).lte(o))return a=$(r)?n?2:3:n?4:1,t;a=$(r)?n?1:4:n?3:2}return t.minus(i).abs()}function ee(e,t,r,n){var i,o,a,u,d,h,f,p,m,g=e.constructor,y=void 0!==r;if(y?(I(r,1,c),void 0===n?n=g.rounding:I(n,0,8)):(r=g.precision,n=g.rounding),e.isFinite()){for(y?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,(a=(f=L(e)).indexOf("."))>=0&&(f=f.replace(".",""),(m=new g(1)).e=f.length-a,m.d=N(L(m),10,i),m.e=m.d.length),o=d=(p=N(f,10,i)).length;0==p[--d];)p.pop();if(p[0]){if(a<0?o--:((e=new g(e)).d=p,e.e=o,p=(e=C(e,m,r,n,0,i)).d,o=e.e,h=s),a=p[r],u=i/2,h=h||void 0!==p[r+1],h=n<4?(void 0!==a||h)&&(0===n||n===(e.s<0?3:2)):a>u||a===u&&(4===n||h||6===n&&1&p[r-1]||n===(e.s<0?8:7)),p.length=r,h)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(d=p.length;!p[d-1];--d);for(a=0,f="";a1)if(16==t||8==t){for(a=16==t?4:3,--d;d%a;d++)f+="0";for(d=(p=N(f,i,t)).length;!p[d-1];--d);for(a=1,f="1.";ad)for(o-=d;o--;)f+="0";else ot)return e.length=t,!0}function re(e){return new this(e).abs()}function ne(e){return new this(e).acos()}function ie(e){return new this(e).acosh()}function oe(e,t){return new this(e).plus(t)}function se(e){return new this(e).asin()}function ae(e){return new this(e).asinh()}function ue(e){return new this(e).atan()}function ce(e){return new this(e).atanh()}function le(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?q(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=q(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,r=this.atan(C(e,t,o,1)),t=q(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(C(e,t,o,1)):(r=q(this,o,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function de(e){return new this(e).cbrt()}function he(e){return B(e=new this(e),e.e+1,2)}function fe(e,t,r){return new this(e).clamp(t,r)}function pe(e){if(!e||"object"!=typeof e)throw Error(m+"Object expected");var t,r,n,i=!0===e.defaults,o=["precision",1,c,"rounding",0,8,"toExpNeg",-u,0,"toExpPos",0,u,"maxE",0,u,"minE",-u,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2]))throw Error(g+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=f[r]),void 0!==(n=e[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(g+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(b);this[r]=!0}else this[r]=!1}return this}function me(e){return new this(e).cos()}function ge(e){return new this(e).cosh()}function ye(e,t){return new this(e).div(t)}function be(e){return new this(e).exp()}function ve(e){return B(e=new this(e),e.e+1,3)}function _e(){var e,t,r=new this(0);for(p=!1,e=0;e=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(b);for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else for(;o=10;i/=10)n++;no.maxE?(i.e=NaN,i.d=null):e.e=10;r/=10)t++;return void(p?t>o.maxE?(i.e=NaN,i.d=null):t{"use strict";var n=r("../../node_modules/object-keys/index.js"),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,u=r("../../node_modules/has-property-descriptors/index.js")(),c=a&&u,l=function(e,t,r,n){var i;(!(t in e)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?a(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},d=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=s.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a{"use strict";t.utils=r("../../node_modules/des.js/lib/des/utils.js"),t.Cipher=r("../../node_modules/des.js/lib/des/cipher.js"),t.DES=r("../../node_modules/des.js/lib/des/des.js"),t.CBC=r("../../node_modules/des.js/lib/des/cbc.js"),t.EDE=r("../../node_modules/des.js/lib/des/ede.js")},"../../node_modules/des.js/lib/des/cbc.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/minimalistic-assert/index.js"),i=r("../../node_modules/inherits/inherits_browser.js"),o={};function s(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t{"use strict";var n=r("../../node_modules/minimalistic-assert/index.js");function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t{"use strict";var n=r("../../node_modules/minimalistic-assert/index.js"),i=r("../../node_modules/inherits/inherits_browser.js"),o=r("../../node_modules/des.js/lib/des/utils.js"),s=r("../../node_modules/des.js/lib/des/cipher.js");function a(){this.tmp=new Array(2),this.keys=null}function u(e){s.call(this,e);var t=new a;this._desState=t,this.deriveKeys(t,e.key)}i(u,s),e.exports=u,u.create=function(e){return new u(e)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(t,0),i=o.readUInt32BE(t,4);o.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var s=0;s>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,e.keys,s)}},u.prototype._update=function(e,t,r,n){var i=this._desState,s=o.readUInt32BE(e,t),a=o.readUInt32BE(e,t+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n>>0,s=h}o.rip(a,s,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var s=r,a=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],l=e.keys[u+1];o.expand(s,e.tmp,0),c^=e.tmp[0],l^=e.tmp[1];var d=o.substitute(c,l),h=s;s=(a^o.permute(d))>>>0,a=h}o.rip(s,a,n,i)}},"../../node_modules/des.js/lib/des/ede.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/minimalistic-assert/index.js"),i=r("../../node_modules/inherits/inherits_browser.js"),o=r("../../node_modules/des.js/lib/des/cipher.js"),s=r("../../node_modules/des.js/lib/des/des.js");function a(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new a(this.type,this.options.key);this._edeState=t}i(u,o),e.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},"../../node_modules/des.js/lib/des/utils.js":(e,t)=>{"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=t>>>a+s&1,i<<=1,i|=e>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=t>>>a+s&1,o<<=1,o|=e>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,n,i){for(var o=0,s=0,a=r.length>>>1,u=0;u>>r[u]&1;for(u=a;u>>r[u]&1;n[i+0]=o>>>0,n[i+1]=s>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length{var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=r("../../node_modules/diffie-hellman/lib/generatePrime.js"),i=r("../../node_modules/diffie-hellman/lib/primes.json"),o=r("../../node_modules/diffie-hellman/lib/dh.js");var s={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(e){var t=new Buffer(i[e].prime,"hex"),r=new Buffer(i[e].gen,"hex");return new o(t,r)},t.createDiffieHellman=t.DiffieHellman=function e(t,r,i,a){return Buffer.isBuffer(r)||void 0===s[r]?e(t,"binary",r,i):(r=r||"binary",a=a||"binary",i=i||new Buffer([2]),Buffer.isBuffer(i)||(i=new Buffer(i,a)),"number"==typeof t?new o(n(t,i),i,!0):(Buffer.isBuffer(t)||(t=new Buffer(t,r)),new o(t,i,!0)))}},"../../node_modules/diffie-hellman/lib/dh.js":(e,t,r)=>{var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=r("../../node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js"),i=new(r("../../node_modules/miller-rabin/lib/mr.js")),o=new n(24),s=new n(11),a=new n(10),u=new n(3),c=new n(7),l=r("../../node_modules/diffie-hellman/lib/generatePrime.js"),d=r("../../node_modules/randombytes/browser.js");function h(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this._pub=new n(e),this}function f(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this._priv=new n(e),this}e.exports=m;var p={};function m(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=h,this.setPrivateKey=f):this._primeCode=8}function g(e,t){var r=new Buffer(e.toArray());return t?r.toString(t):r}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var d,h=0;if(e.isEven()||!l.simpleSieve||!l.fermatTest(e)||!i.test(e))return h+=1,h+="02"===r||"05"===r?8:4,p[n]=h,h;switch(i.test(e.shrn(1))||(h+=2),r){case"02":e.mod(o).cmp(s)&&(h+=8);break;case"05":(d=e.mod(a)).cmp(u)&&d.cmp(c)&&(h+=8);break;default:h+=4}return p[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new n(d(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(e){var t=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new Buffer(t.toArray()),i=this.getPrime();if(r.length{var n=r("../../node_modules/randombytes/browser.js");e.exports=b,b.simpleSieve=g,b.fermatTest=y;var i=r("../../node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js"),o=new i(24),s=new(r("../../node_modules/miller-rabin/lib/mr.js")),a=new i(1),u=new i(2),c=new i(5),l=(new i(16),new i(8),new i(10)),d=new i(3),h=(new i(7),new i(11)),f=new i(4),p=(new i(12),null);function m(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;ie;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;r.mod(l).cmp(d);)r.iadd(f)}else for(;r.mod(o).cmp(h);)r.iadd(f);if(g(p=r.shrn(1))&&g(r)&&y(p)&&y(r)&&s.test(p)&&s.test(r))return r}}},"../../node_modules/diffie-hellman/node_modules/bn.js/lib/bn.js":function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var Buffer;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{Buffer="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r("?7dc1").Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=a(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],_=8191&v,w=v>>>13,M=0|s[4],j=8191&M,S=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,O=0|s[6],T=8191&O,P=O>>>13,k=0|s[7],I=8191&k,R=k>>>13,N=0|s[8],C=8191&N,B=N>>>13,L=0|s[9],F=8191&L,D=L>>>13,q=0|a[0],U=8191&q,z=q>>>13,V=0|a[1],$=8191&V,H=V>>>13,K=0|a[2],X=8191&K,Z=K>>>13,J=0|a[3],G=8191&J,W=J>>>13,Y=0|a[4],Q=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],de=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(h,U)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(m,U)|0,o=Math.imul(m,z);var ye=(c+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(b,U)|0,o=Math.imul(b,z),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var be=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var ve=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,z))+Math.imul(S,U)|0,o=Math.imul(S,z),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,W)|0;var _e=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(x,U)|0,o=Math.imul(x,z),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var we=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var Me=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(R,U)|0,o=Math.imul(R,z),n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var je=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,H)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Se=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(D,U)|0,o=Math.imul(D,z),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,H)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Ae=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,H))+Math.imul(D,$)|0,o=Math.imul(D,H),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,he)|0;var Ee=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,Z))+Math.imul(D,X)|0,o=Math.imul(D,Z),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,he)|0;var xe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,G),i=(i=Math.imul(F,W))+Math.imul(D,G)|0,o=Math.imul(D,W),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,he)|0;var Te=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(T,de)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,he)|0;var Pe=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,oe),i=(i=Math.imul(F,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(R,de)|0,o=o+Math.imul(R,he)|0;var ke=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,ce))+Math.imul(D,ue)|0,o=Math.imul(D,ce),n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,he)|0;var Ie=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,de),i=(i=Math.imul(F,he))+Math.imul(D,de)|0,o=Math.imul(D,he);var Re=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(c+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(D,pe)|0))<<13)|0;return c=((o=Math.imul(D,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=_e,u[5]=we,u[6]=Me,u[7]=je,u[8]=Se,u[9]=Ae,u[10]=Ee,u[11]=xe,u[12]=Oe,u[13]=Te,u[14]=Pe,u[15]=ke,u[16]=Ie,u[17]=Re,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new M(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function j(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new j(e)},i(j,M),j.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},j.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},j.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},j.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},j.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/elliptic/lib/elliptic.js":(e,t,r)=>{"use strict";var n=t;n.version=r("../../node_modules/elliptic/package.json").i8,n.utils=r("../../node_modules/elliptic/lib/elliptic/utils.js"),n.rand=r("../../node_modules/brorand/index.js"),n.curve=r("../../node_modules/elliptic/lib/elliptic/curve/index.js"),n.curves=r("../../node_modules/elliptic/lib/elliptic/curves.js"),n.ec=r("../../node_modules/elliptic/lib/elliptic/ec/index.js"),n.eddsa=r("../../node_modules/elliptic/lib/elliptic/eddsa/index.js")},"../../node_modules/elliptic/lib/elliptic/curve/base.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),i=r("../../node_modules/elliptic/lib/elliptic/utils.js"),o=i.getNAF,s=i.getJSF,a=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<=s;l--)u=(u<<1)+n[l];c.push(u)}for(var d=this.jpoint(null,null,null),h=this.jpoint(null,null,null),f=i;f>0;f--){for(s=0;s=0;c--){for(var l=0;c>=0&&0===s[c];c--)l++;if(c>=0&&l++,u=u.dblp(l),c<0)break;var d=s[c];a(0!==d),u="affine"===e.type?d>0?u.mixedAdd(i[d-1>>1]):u.mixedAdd(i[-d-1>>1].neg()):d>0?u.add(i[d-1>>1]):u.add(i[-d-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var a,u,c,l=this._wnafT1,d=this._wnafT2,h=this._wnafT3,f=0;for(a=0;a=1;a-=2){var m=a-1,g=a;if(1===l[m]&&1===l[g]){var y=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(y[1]=t[m].add(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].add(t[g].neg())):(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[m],r[g]);for(f=Math.max(v[0].length,f),h[m]=new Array(f),h[g]=new Array(f),u=0;u=0;a--){for(var S=0;a>=0;){var A=!0;for(u=0;u=0&&S++,M=M.dblp(S),a<0)break;for(u=0;u0?c=d[u][E-1>>1]:E<0&&(c=d[u][-E-1>>1].neg()),M="affine"===c.type?M.mixedAdd(c):M.add(c))}}for(a=0;a=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i{"use strict";var n=r("../../node_modules/elliptic/lib/elliptic/utils.js"),i=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),o=r("../../node_modules/inherits/inherits_browser.js"),s=r("../../node_modules/elliptic/lib/elliptic/curve/base.js"),a=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function Point(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(t&&!u||!t&&u)&&(a=a.redNeg()),this.point(e,a)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(Point,s.BasePoint),u.prototype.pointFromJSON=function(e){return Point.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new Point(this,e,t,r,n)},Point.fromJSON=function(e,t){return new Point(e,t[0],t[1],t[2])},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Point.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),u=i.redMul(s),c=o.redMul(a),l=i.redMul(a),d=s.redMul(o);return this.curve.point(u,c,d,l)},Point.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(e=s.redSub(a).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=s.redSub(a).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(t),c=o.redMul(s),l=a.redMul(u),d=o.redMul(u),h=s.redMul(a);return this.curve.point(c,l,h,d)},Point.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),c=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),d=n.redMul(u).redMul(l);return this.curve.twisted?(t=n.redMul(c).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(d,t,r)},Point.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},Point.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},Point.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},Point.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},Point.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},"../../node_modules/elliptic/lib/elliptic/curve/index.js":(e,t,r)=>{"use strict";var n=t;n.base=r("../../node_modules/elliptic/lib/elliptic/curve/base.js"),n.short=r("../../node_modules/elliptic/lib/elliptic/curve/short.js"),n.mont=r("../../node_modules/elliptic/lib/elliptic/curve/mont.js"),n.edwards=r("../../node_modules/elliptic/lib/elliptic/curve/edwards.js")},"../../node_modules/elliptic/lib/elliptic/curve/mont.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),i=r("../../node_modules/inherits/inherits_browser.js"),o=r("../../node_modules/elliptic/lib/elliptic/curve/base.js"),s=r("../../node_modules/elliptic/lib/elliptic/utils.js");function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(Point,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new Point(this,e,t)},a.prototype.pointFromJSON=function(e){return Point.fromJSON(this,e)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(e,t){return new Point(e,t[0],t[1]||e.one)},Point.prototype.inspect=function(){return this.isInfinity()?"":""},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},Point.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},"../../node_modules/elliptic/lib/elliptic/curve/short.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/elliptic/lib/elliptic/utils.js"),i=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),o=r("../../node_modules/inherits/inherits_browser.js"),s=r("../../node_modules/elliptic/lib/elliptic/curve/base.js"),a=n.assert;function u(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,u,c,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,f=this.n.clone(),p=new i(1),m=new i(0),g=new i(0),y=new i(1),b=0;0!==h.cmpn(0);){var v=f.div(h);c=f.sub(v.mul(h)),l=g.sub(v.mul(p));var _=y.sub(v.mul(m));if(!n&&c.cmp(d)<0)t=u.neg(),r=p,n=c.neg(),o=l;else if(n&&2==++b)break;u=c,f=h,h=c,g=p,p=l,y=m,m=_}s=c.neg(),a=l;var w=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(w)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Point.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Point.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Point.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Point.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Point.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Point.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,s.BasePoint),u.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),d=n.redMul(c),h=u.redSqr().redIAdd(l).redISub(d).redISub(d),f=u.redMul(d.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(h,f,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),l=r.redMul(u),d=a.redSqr().redIAdd(c).redISub(l).redISub(l),h=a.redMul(l.redISub(d)).redISub(i.redMul(c)),f=this.z.redMul(s);return this.curve.jpoint(d,h,f)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},"../../node_modules/elliptic/lib/elliptic/curves.js":(e,t,r)=>{"use strict";var n,i=t,o=r("../../node_modules/hash.js/lib/hash.js"),s=r("../../node_modules/elliptic/lib/elliptic/curve/index.js"),a=r("../../node_modules/elliptic/lib/elliptic/utils.js").assert;function u(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r("../../node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js")}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},"../../node_modules/elliptic/lib/elliptic/ec/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),i=r("../../node_modules/hmac-drbg/lib/hmac-drbg.js"),o=r("../../node_modules/elliptic/lib/elliptic/utils.js"),s=r("../../node_modules/elliptic/lib/elliptic/curves.js"),a=r("../../node_modules/brorand/index.js"),u=o.assert,c=r("../../node_modules/elliptic/lib/elliptic/ec/key.js"),l=r("../../node_modules/elliptic/lib/elliptic/ec/signature.js");function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new c(this,e)},d.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},d.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),u=e.toArray("be",s),c=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),d=this.n.sub(new n(1)),h=0;;h++){var f=o.k?o.k(h):new n(c.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(d)>=0)){var p=this.g.mul(f);if(!p.isInfinity()){var m=p.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var y=f.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),b^=1),new l({r:g,s:y,recoveryParam:b})}}}}}},d.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new l(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),c=u.mul(e).umod(this.n),d=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),d)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},d.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new l(t,i);var o=this.n,s=new n(e),a=t.r,c=t.s,d=1&r,h=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),d):this.curve.pointFromX(a,d);var f=t.r.invm(o),p=o.sub(s).mul(f).umod(o),m=c.mul(f).umod(o);return this.g.mulAdd(p,a,m)},d.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},"../../node_modules/elliptic/lib/elliptic/ec/key.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),i=r("../../node_modules/elliptic/lib/elliptic/utils.js").assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return""}},"../../node_modules/elliptic/lib/elliptic/ec/signature.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),i=r("../../node_modules/elliptic/lib/elliptic/utils.js"),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o>>=0;return!(i<=127)&&(t.place=s,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=u(e,r);if(!1===s)return!1;var c=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var l=u(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;var d=e.slice(r.place,l+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new n(c),this.s=new n(d),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,e)}},"../../node_modules/elliptic/lib/elliptic/eddsa/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/hash.js/lib/hash.js"),i=r("../../node_modules/elliptic/lib/elliptic/curves.js"),o=r("../../node_modules/elliptic/lib/elliptic/utils.js"),s=o.assert,a=o.parseBytes,u=r("../../node_modules/elliptic/lib/elliptic/eddsa/key.js"),c=r("../../node_modules/elliptic/lib/elliptic/eddsa/signature.js");function l(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},l.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t{"use strict";var n=r("../../node_modules/elliptic/lib/elliptic/utils.js"),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},"../../node_modules/elliptic/lib/elliptic/eddsa/signature.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),i=r("../../node_modules/elliptic/lib/elliptic/utils.js"),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},"../../node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js":e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},"../../node_modules/elliptic/lib/elliptic/utils.js":(e,t,r)=>{"use strict";var n=t,i=r("../../node_modules/elliptic/node_modules/bn.js/lib/bn.js"),o=r("../../node_modules/minimalistic-assert/index.js"),s=r("../../node_modules/minimalistic-crypto-utils/lib/utils.js");n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),s=0==(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(s),a=0==(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},"../../node_modules/elliptic/node_modules/bn.js/lib/bn.js":function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var Buffer;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{Buffer="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r("?f84f").Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=a(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],_=8191&v,w=v>>>13,M=0|s[4],j=8191&M,S=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,O=0|s[6],T=8191&O,P=O>>>13,k=0|s[7],I=8191&k,R=k>>>13,N=0|s[8],C=8191&N,B=N>>>13,L=0|s[9],F=8191&L,D=L>>>13,q=0|a[0],U=8191&q,z=q>>>13,V=0|a[1],$=8191&V,H=V>>>13,K=0|a[2],X=8191&K,Z=K>>>13,J=0|a[3],G=8191&J,W=J>>>13,Y=0|a[4],Q=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],de=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(h,U)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(m,U)|0,o=Math.imul(m,z);var ye=(c+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(b,U)|0,o=Math.imul(b,z),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var be=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var ve=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,z))+Math.imul(S,U)|0,o=Math.imul(S,z),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,W)|0;var _e=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(x,U)|0,o=Math.imul(x,z),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var we=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var Me=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(R,U)|0,o=Math.imul(R,z),n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var je=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,H)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Se=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(D,U)|0,o=Math.imul(D,z),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,H)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Ae=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,H))+Math.imul(D,$)|0,o=Math.imul(D,H),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,he)|0;var Ee=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,Z))+Math.imul(D,X)|0,o=Math.imul(D,Z),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,he)|0;var xe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,G),i=(i=Math.imul(F,W))+Math.imul(D,G)|0,o=Math.imul(D,W),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,he)|0;var Te=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(T,de)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,he)|0;var Pe=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,oe),i=(i=Math.imul(F,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(R,de)|0,o=o+Math.imul(R,he)|0;var ke=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,ce))+Math.imul(D,ue)|0,o=Math.imul(D,ce),n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,he)|0;var Ie=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,de),i=(i=Math.imul(F,he))+Math.imul(D,de)|0,o=Math.imul(D,he);var Re=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(c+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(D,pe)|0))<<13)|0;return c=((o=Math.imul(D,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=_e,u[5]=we,u[6]=Me,u[7]=je,u[8]=Se,u[9]=Ae,u[10]=Ee,u[11]=xe,u[12]=Oe,u[13]=Te,u[14]=Pe,u[15]=ke,u[16]=Ie,u[17]=Re,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new M(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function j(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new j(e)},i(j,M),j.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},j.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},j.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},j.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},j.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/es6-object-assign/index.js":e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n{"use strict";var n,i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,o="object"==typeof Reflect?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,e.exports.once=function(e,t){return new i((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}b(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&b(e,"error",t,r)}(e,i,{once:!0})}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,events,o,s;if(l(r),void 0===(events=e._events)?(events=e._events=Object.create(null),e._eventsCount=0):(void 0!==events.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),events=e._events),o=events[t]),void 0===o)o=events[t]=r,++e._eventsCount;else if("function"==typeof o?o=events[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=d(e))>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=o.length,s=a,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function m(e,t,r){var events=e._events;if(void 0===events)return[];var n=events[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(i=t[0]),i instanceof Error)throw i;var o=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw o.context=i,o}var a=events[e];if(void 0===a)return!1;if("function"==typeof a)s(a,this,t);else{var u=a.length,c=y(a,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return m(this,e,!0)},u.prototype.rawListeners=function(e){return m(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},u.prototype.listenerCount=g,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},"../../node_modules/evp_bytestokey/index.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/md5.js/index.js");e.exports=function(e,t,r,i){if(Buffer.isBuffer(e)||(e=Buffer.from(e,"binary")),t&&(Buffer.isBuffer(t)||(t=Buffer.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var o=r/8,s=Buffer.alloc(o),a=Buffer.alloc(i||0),u=Buffer.alloc(0);o>0||i>0;){var c=new n;c.update(u),c.update(e),t&&c.update(t),u=c.digest();var l=0;if(o>0){var d=s.length-o;l=Math.min(o,u.length),u.copy(s,d,0,l),o-=l}if(l0){var h=a.length-i,f=Math.min(i,u.length-l);u.copy(a,h,l,l+f),i-=f}}return u.fill(0),{key:s,iv:a}}},"../../node_modules/for-each/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/is-callable/index.js"),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n{"use strict";var t=Array.prototype.slice,r=Object.prototype.toString;e.exports=function(e){var n=this;if("function"!=typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i,o=t.call(arguments,1),s=Math.max(0,n.length-o.length),a=[],u=0;u{"use strict";var n=r("../../node_modules/function-bind/implementation.js");e.exports=Function.prototype.bind||n},"../../node_modules/get-intrinsic/index.js":(e,t,r)=>{"use strict";var n,i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,o=SyntaxError,s=Function,a=TypeError,u=function(e){try{return s('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var l=function(){throw new a},d=c?function(){try{return l}catch(e){try{return c(arguments,"callee").get}catch(e){return l}}}():l,h=r("../../node_modules/has-symbols/index.js")(),f=Object.getPrototypeOf||function(e){return e.__proto__},p={},m="undefined"==typeof Uint8Array?n:f(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":void 0===i?n:i,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?f(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":d,"%TypedArray%":m,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};try{null.error}catch(e){var y=f(f(e));g["%Error.prototype%"]=y}var b=function e(t){var r;if("%AsyncFunction%"===t)r=u("async function () {}");else if("%GeneratorFunction%"===t)r=u("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=u("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=f(i.prototype))}return g[t]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=r("../../node_modules/function-bind/index.js"),w=r("../../node_modules/has/src/index.js"),M=_.call(Function.call,Array.prototype.concat),j=_.call(Function.apply,Array.prototype.splice),S=_.call(Function.call,String.prototype.replace),A=_.call(Function.call,String.prototype.slice),E=_.call(Function.call,RegExp.prototype.exec),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,T=function(e,t){var r,n=e;if(w(v,n)&&(n="%"+(r=v[n])[0]+"%"),w(g,n)){var i=g[n];if(i===p&&(i=b(n)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===E(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=A(e,0,1),r=A(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return S(e,x,(function(e,t,r,i){n[n.length]=r?S(i,O,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=T("%"+n+"%",t),s=i.name,u=i.value,l=!1,d=i.alias;d&&(n=d[0],j(r,M([0,1],d)));for(var h=1,f=!0;h=r.length){var b=c(u,p);u=(f=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[p]}else f=w(u,p),u=u[p];f&&!l&&(g[s]=u)}}return u}},"../../node_modules/gopd/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/get-intrinsic/index.js")("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},"../../node_modules/has-property-descriptors/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/get-intrinsic/index.js")("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},"../../node_modules/has-symbols/index.js":(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r("../../node_modules/has-symbols/shams.js");e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},"../../node_modules/has-symbols/shams.js":e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},"../../node_modules/has-tostringtag/shams.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/has-symbols/shams.js");e.exports=function(){return n()&&!!Symbol.toStringTag}},"../../node_modules/has/src/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/function-bind/index.js");e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},"../../node_modules/hash-base/index.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=r("../../node_modules/readable-stream/readable-browser.js").Transform;function i(e){n.call(this),this._block=Buffer.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r("../../node_modules/inherits/inherits_browser.js")(i,n),i.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},i.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},i.prototype.update=function(e,t){if(function(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");Buffer.isBuffer(e)||(e=Buffer.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},"../../node_modules/hash.js/lib/hash.js":(e,t,r)=>{var n=t;n.utils=r("../../node_modules/hash.js/lib/hash/utils.js"),n.common=r("../../node_modules/hash.js/lib/hash/common.js"),n.sha=r("../../node_modules/hash.js/lib/hash/sha.js"),n.ripemd=r("../../node_modules/hash.js/lib/hash/ripemd.js"),n.hmac=r("../../node_modules/hash.js/lib/hash/hmac.js"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},"../../node_modules/hash.js/lib/hash/common.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/hash.js/lib/hash/utils.js"),i=r("../../node_modules/minimalistic-assert/index.js");function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o{"use strict";var n=r("../../node_modules/hash.js/lib/hash/utils.js"),i=r("../../node_modules/minimalistic-assert/index.js");function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t{"use strict";var n=r("../../node_modules/hash.js/lib/hash/utils.js"),i=r("../../node_modules/hash.js/lib/hash/common.js"),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function f(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,c),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],l=this.h[4],b=r,v=n,_=i,w=c,M=l,j=0;j<80;j++){var S=s(o(u(r,d(j,n,i,c),e[p[j]+t],h(j)),g[j]),l);r=l,l=c,c=o(i,10),i=n,n=S,S=s(o(u(b,d(79-j,v,_,w),e[m[j]+t],f(j)),y[j]),M),b=M,M=w,w=o(_,10),_=v,v=S}S=a(this.h[1],i,w),this.h[1]=a(this.h[2],c,M),this.h[2]=a(this.h[3],l,b),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,_),this.h[0]=S},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},"../../node_modules/hash.js/lib/hash/sha.js":(e,t,r)=>{"use strict";t.sha1=r("../../node_modules/hash.js/lib/hash/sha/1.js"),t.sha224=r("../../node_modules/hash.js/lib/hash/sha/224.js"),t.sha256=r("../../node_modules/hash.js/lib/hash/sha/256.js"),t.sha384=r("../../node_modules/hash.js/lib/hash/sha/384.js"),t.sha512=r("../../node_modules/hash.js/lib/hash/sha/512.js")},"../../node_modules/hash.js/lib/hash/sha/1.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/hash.js/lib/hash/utils.js"),i=r("../../node_modules/hash.js/lib/hash/common.js"),o=r("../../node_modules/hash.js/lib/hash/sha/common.js"),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=o.ft_1,l=i.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,l),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n{"use strict";var n=r("../../node_modules/hash.js/lib/hash/utils.js"),i=r("../../node_modules/hash.js/lib/hash/sha/256.js");function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},"../../node_modules/hash.js/lib/hash/sha/256.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/hash.js/lib/hash/utils.js"),i=r("../../node_modules/hash.js/lib/hash/common.js"),o=r("../../node_modules/hash.js/lib/hash/sha/common.js"),s=r("../../node_modules/minimalistic-assert/index.js"),a=n.sum32,u=n.sum32_4,c=n.sum32_5,l=o.ch32,d=o.maj32,h=o.s0_256,f=o.s1_256,p=o.g0_256,m=o.g1_256,g=i.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n{"use strict";var n=r("../../node_modules/hash.js/lib/hash/utils.js"),i=r("../../node_modules/hash.js/lib/hash/sha/512.js");function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},"../../node_modules/hash.js/lib/hash/sha/512.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/hash.js/lib/hash/utils.js"),i=r("../../node_modules/hash.js/lib/hash/common.js"),o=r("../../node_modules/minimalistic-assert/index.js"),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,l=n.sum64,d=n.sum64_hi,h=n.sum64_lo,f=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,g=n.sum64_5_lo,y=i.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function _(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function w(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function M(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function j(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function S(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function x(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function O(e,t){var r=s(e,t,1)^s(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,1)^a(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,19)^s(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function k(e,t){var r=a(e,t,19)^a(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,y),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n{"use strict";var n=r("../../node_modules/hash.js/lib/hash/utils.js").rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},"../../node_modules/hash.js/lib/hash/utils.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/minimalistic-assert/index.js"),i=r("../../node_modules/inherits/inherits_browser.js");function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var u=0,c=t;return u+=(c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,u,c){var l=0,d=t;return l+=(d=d+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,u,c){return t+n+o+a+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},"../../node_modules/hmac-drbg/lib/hmac-drbg.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/hash.js/lib/hash.js"),i=r("../../node_modules/minimalistic-crypto-utils/lib/utils.js"),o=r("../../node_modules/minimalistic-assert/index.js");function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length{ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,d=r?i-1:0,h=r?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=c}return(f?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*u-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<0;e[r+f]=255&s,f+=p,s/=256,c-=8);e[r+f-p]|=128*m}},"../../node_modules/inherits/inherits_browser.js":e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},"../../node_modules/is-arguments/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/has-tostringtag/shams.js")(),i=r("../../node_modules/call-bind/callBound.js")("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},"../../node_modules/is-callable/index.js":e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),d=function(){return!1};if("object"==typeof document){var h=document.all;u.call(h)===u.call(document.all)&&(d=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},"../../node_modules/is-generator-function/index.js":(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r("../../node_modules/has-tostringtag/shams.js")(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},"../../node_modules/is-nan/implementation.js":e=>{"use strict";e.exports=function(e){return e!=e}},"../../node_modules/is-nan/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/call-bind/index.js"),i=r("../../node_modules/define-properties/index.js"),o=r("../../node_modules/is-nan/implementation.js"),s=r("../../node_modules/is-nan/polyfill.js"),a=r("../../node_modules/is-nan/shim.js"),u=n(s(),Number);i(u,{getPolyfill:s,implementation:o,shim:a}),e.exports=u},"../../node_modules/is-nan/polyfill.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/is-nan/implementation.js");e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},"../../node_modules/is-nan/shim.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/define-properties/index.js"),i=r("../../node_modules/is-nan/polyfill.js");e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},"../../node_modules/is-typed-array/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/for-each/index.js"),i=r("../../node_modules/available-typed-arrays/index.js"),o=r("../../node_modules/call-bind/callBound.js"),s=o("Object.prototype.toString"),a=r("../../node_modules/has-tostringtag/shams.js")(),u=r("../../node_modules/gopd/index.js"),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),d=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1}return!!u&&function(e){var t=!1;return n(f,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},"../../node_modules/jsonschema/lib/attribute.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/jsonschema/lib/helpers.js"),i=n.ValidatorResult,o=n.SchemaError,s={ignoreProperties:{id:!0,default:!0,description:!0,title:!0,exclusiveMinimum:!0,exclusiveMaximum:!0,additionalItems:!0,$schema:!0,$ref:!0,extends:!0}},a=s.validators={};function u(e,t,r,n,i){var o=this.validateSchema(e,i,t,r);return!o.valid&&n instanceof Function&&n(o),o.valid}function c(e,t,r,n,i,o){if(!t.properties||void 0===t.properties[i])if(!1===t.additionalProperties)o.addError({name:"additionalProperties",argument:i,message:"additionalProperty "+JSON.stringify(i)+" exists in instance when not allowed"});else{var s=t.additionalProperties||{};"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,i,s,r,n);var a=this.validateSchema(e[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}a.type=function(e,t,r,n){if(void 0===e)return null;var o=new i(e,t,r,n),s=Array.isArray(t.type)?t.type:[t.type];if(!s.some(this.testType.bind(this,e,t,r,n))){var a=s.map((function(e){return e.id&&"<"+e.id+">"||e+""}));o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o},a.anyOf=function(e,t,r,n){if(void 0===e)return null;var s=new i(e,t,r,n),a=new i(e,t,r,n);if(!Array.isArray(t.anyOf))throw new o("anyOf must be an array");if(!t.anyOf.some(u.bind(this,e,r,n,(function(e){a.importErrors(e)})))){var c=t.anyOf.map((function(e,t){return e.id&&"<"+e.id+">"||e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));r.nestedErrors&&s.importErrors(a),s.addError({name:"anyOf",argument:c,message:"is not any of "+c.join(",")})}return s},a.allOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.allOf))throw new o("allOf must be an array");var s=new i(e,t,r,n),a=this;return t.allOf.forEach((function(t,i){var o=a.validateSchema(e,t,r,n);if(!o.valid){var u=t.id&&"<"+t.id+">"||t.title&&JSON.stringify(t.title)||t.$ref&&"<"+t.$ref+">"||"[subschema "+i+"]";s.addError({name:"allOf",argument:{id:u,length:o.errors.length,valid:o},message:"does not match allOf schema "+u+" with "+o.errors.length+" error[s]:"}),s.importErrors(o)}})),s},a.oneOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.oneOf))throw new o("oneOf must be an array");var s=new i(e,t,r,n),a=new i(e,t,r,n),c=t.oneOf.filter(u.bind(this,e,r,n,(function(e){a.importErrors(e)}))).length,l=t.oneOf.map((function(e,t){return e.id&&"<"+e.id+">"||e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));return 1!==c&&(r.nestedErrors&&s.importErrors(a),s.addError({name:"oneOf",argument:l,message:"is not exactly one from "+l.join(",")})),s},a.properties=function(e,t,r,n){if(void 0!==e&&e instanceof Object){var o=new i(e,t,r,n),s=t.properties||{};for(var a in s){"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,a,s[a],r,n);var u=e?e[a]:void 0,c=this.validateSchema(u,s[a],r,n.makeChild(s[a],a));c.instance!==o.instance[a]&&(o.instance[a]=c.instance),o.importErrors(c)}return o}},a.patternProperties=function(e,t,r,n){if(void 0!==e&&this.types.object(e)){var o=new i(e,t,r,n),s=t.patternProperties||{};for(var a in e){var u=!0;for(var l in s){if(new RegExp(l).test(a)){u=!1,"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,a,s[l],r,n);var d=this.validateSchema(e[a],s[l],r,n.makeChild(s[l],a));d.instance!==o.instance[a]&&(o.instance[a]=d.instance),o.importErrors(d)}}u&&c.call(this,e,t,r,n,a,o)}return o}},a.additionalProperties=function(e,t,r,n){if(void 0!==e&&this.types.object(e)){if(t.patternProperties)return null;var o=new i(e,t,r,n);for(var s in e)c.call(this,e,t,r,n,s,o);return o}},a.minProperties=function(e,t,r,n){if(!e||"object"!=typeof e)return null;var o=new i(e,t,r,n);return Object.keys(e).length>=t.minProperties||o.addError({name:"minProperties",argument:t.minProperties,message:"does not meet minimum property length of "+t.minProperties}),o},a.maxProperties=function(e,t,r,n){if(!e||"object"!=typeof e)return null;var o=new i(e,t,r,n);return Object.keys(e).length<=t.maxProperties||o.addError({name:"maxProperties",argument:t.maxProperties,message:"does not meet maximum property length of "+t.maxProperties}),o},a.items=function(e,t,r,n){if(!Array.isArray(e))return null;var o=this,s=new i(e,t,r,n);return void 0!==e&&t.items?(e.every((function(e,i){var a=Array.isArray(t.items)?t.items[i]||t.additionalItems:t.items;if(void 0===a)return!0;if(!1===a)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(e,a,r,n.makeChild(a,i));return u.instance!==s.instance[i]&&(s.instance[i]=u.instance),s.importErrors(u),!0})),s):s},a.minimum=function(e,t,r,n){if("number"!=typeof e)return null;var o=new i(e,t,r,n);return(t.exclusiveMinimum&&!0===t.exclusiveMinimum?e>t.minimum:e>=t.minimum)||o.addError({name:"minimum",argument:t.minimum,message:"must have a minimum value of "+t.minimum}),o},a.maximum=function(e,t,r,n){if("number"!=typeof e)return null;var o=new i(e,t,r,n);return(t.exclusiveMaximum&&!0===t.exclusiveMaximum?e=t.minLength||o.addError({name:"minLength",argument:t.minLength,message:"does not meet minimum length of "+t.minLength}),o},a.maxLength=function(e,t,r,n){if("string"!=typeof e)return null;var o=new i(e,t,r,n);return e.length<=t.maxLength||o.addError({name:"maxLength",argument:t.maxLength,message:"does not meet maximum length of "+t.maxLength}),o},a.minItems=function(e,t,r,n){if(!Array.isArray(e))return null;var o=new i(e,t,r,n);return e.length>=t.minItems||o.addError({name:"minItems",argument:t.minItems,message:"does not meet minimum length of "+t.minItems}),o},a.maxItems=function(e,t,r,n){if(!Array.isArray(e))return null;var o=new i(e,t,r,n);return e.length<=t.maxItems||o.addError({name:"maxItems",argument:t.maxItems,message:"does not meet maximum length of "+t.maxItems}),o},a.uniqueItems=function(e,t,r,o){var s=new i(e,t,r,o);if(!Array.isArray(e))return s;return e.every((function(e,t,r){for(var i=t+1;i"||i;s.addError({name:"not",argument:a,message:"is of prohibited type "+a})}})),s):null},e.exports=s},"../../node_modules/jsonschema/lib/helpers.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/url/url.js"),i=t.ValidationError=function(e,t,r,n,i,o){n&&(this.property=n),e&&(this.message=e),r&&(r.id?this.schema=r.id:this.schema=r),t&&(this.instance=t),this.name=i,this.argument=o,this.stack=this.toString()};i.prototype.toString=function(){return this.property+" "+this.message};var o=t.ValidatorResult=function(e,t,r,n){this.instance=e,this.schema=t,this.propertyPath=n.propertyPath,this.errors=[],this.throwError=r&&r.throwError,this.disableFormat=r&&!0===r.disableFormat};function s(e,t){return t+": "+e.toString()+"\n"}o.prototype.addError=function(e){var t;if("string"==typeof e)t=new i(e,this.instance,this.schema,this.propertyPath);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");t=new i(e.message,this.instance,this.schema,this.propertyPath,e.name,e.argument)}if(this.throwError)throw t;return this.errors.push(t),t},o.prototype.importErrors=function(e){"string"==typeof e||e&&e.validatorType?this.addError(e):e&&e.errors&&Array.prototype.push.apply(this.errors,e.errors)},o.prototype.toString=function(e){return this.errors.map(s).join("")},Object.defineProperty(o.prototype,"valid",{get:function(){return!this.errors.length}});var a=t.SchemaError=function e(t,r){this.message=t,this.schema=r,Error.call(this,t),Error.captureStackTrace(this,e)};a.prototype=Object.create(Error.prototype,{constructor:{value:a,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var u=t.SchemaContext=function(e,t,r,n,i){this.schema=e,this.options=t,this.propertyPath=r,this.base=n,this.schemas=i};u.prototype.resolve=function(e){return n.resolve(this.base,e)},u.prototype.makeChild=function(e,t){var r=void 0===t?this.propertyPath:this.propertyPath+l(t),i=n.resolve(this.base,e.id||""),o=new u(e,this.options,r,i,Object.create(this.schemas));return e.id&&!o.schemas[i]&&(o.schemas[i]=e),o};var c=t.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/,"utc-millisec":function(e){return"string"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)},regex:function(e){var t=!0;try{new RegExp(e)}catch(e){t=!1}return t},style:/\s*(.+?):\s*([^;]+);?/g,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/};c.regexp=c.regex,c.pattern=c.regex,c.ipv4=c["ip-address"],t.isFormat=function(e,t,r){if("string"==typeof e&&void 0!==c[t]){if(c[t]instanceof RegExp)return c[t].test(e);if("function"==typeof c[t])return c[t](e)}else if(r&&r.customFormats&&"function"==typeof r.customFormats[t])return r.customFormats[t](e);return!0};var l=t.makeSuffix=function(e){return(e=e.toString()).match(/[.\s\[\]]/)||e.match(/^[\d]/)?e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]":"."+e};function d(e,t,r,n){"object"==typeof r?t[n]=p(e[n],r):-1===e.indexOf(r)&&t.push(r)}function h(e,t,r){t[r]=e[r]}function f(e,t,r,n){"object"==typeof t[n]&&t[n]&&e[n]?r[n]=p(e[n],t[n]):r[n]=t[n]}function p(e,t){var r=Array.isArray(t),n=r&&[]||{};return r?(e=e||[],n=n.concat(e),t.forEach(d.bind(null,e,n))):(e&&"object"==typeof e&&Object.keys(e).forEach(h.bind(null,e,n)),Object.keys(t).forEach(f.bind(null,e,t,n))),n}function m(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}t.deepCompareStrict=function e(t,r){if(typeof t!=typeof r)return!1;if(t instanceof Array)return r instanceof Array&&(t.length===r.length&&t.every((function(n,i){return e(t[i],r[i])})));if("object"==typeof t){if(!t||!r)return t===r;var n=Object.keys(t),i=Object.keys(r);return n.length===i.length&&n.every((function(n){return e(t[n],r[n])}))}return t===r},e.exports.deepMerge=p,t.objectGetPath=function(e,t){for(var r,n=t.split("/").slice(1);"string"==typeof(r=n.shift());){var i=decodeURIComponent(r.replace(/~0/,"~").replace(/~1/g,"/"));if(!(i in e))return;e=e[i]}return e},t.encodePath=function(e){return e.map(m).join("")},t.getDecimalPlaces=function(e){var t=0;if(isNaN(e))return t;"number"!=typeof e&&(e=Number(e));var r=e.toString().split("e");if(2===r.length){if("-"!==r[1][0])return t;t=Number(r[1].slice(1))}var n=r[0].split(".");return 2===n.length&&(t+=n[1].length),t}},"../../node_modules/jsonschema/lib/index.js":(e,t,r)=>{"use strict";var n=e.exports.Validator=r("../../node_modules/jsonschema/lib/validator.js");e.exports.ValidatorResult=r("../../node_modules/jsonschema/lib/helpers.js").ValidatorResult,e.exports.ValidationError=r("../../node_modules/jsonschema/lib/helpers.js").ValidationError,e.exports.SchemaError=r("../../node_modules/jsonschema/lib/helpers.js").SchemaError,e.exports.validate=function(e,t,r){return(new n).validate(e,t,r)}},"../../node_modules/jsonschema/lib/validator.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/url/url.js"),i=r("../../node_modules/jsonschema/lib/attribute.js"),o=r("../../node_modules/jsonschema/lib/helpers.js"),s=o.ValidatorResult,a=o.SchemaError,u=o.SchemaContext,c=function e(){this.customFormats=Object.create(e.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(d),this.attributes=Object.create(i.validators)};function l(e){var t="string"==typeof e?e:e.$ref;return"string"==typeof t&&t}c.prototype.customFormats={},c.prototype.schemas=null,c.prototype.types=null,c.prototype.attributes=null,c.prototype.unresolvedRefs=null,c.prototype.addSchema=function(e,t){if(!e)return null;var r=t||e.id;return this.addSubSchema(r,e),r&&(this.schemas[r]=e),this.schemas[r]},c.prototype.addSubSchema=function(e,t){if(t&&"object"==typeof t){if(!t.$ref){var r=t.id&&n.resolve(e,t.id),i=r||e;if(r){if(this.schemas[r]){if(!o.deepCompareStrict(this.schemas[r],t))throw new Error("Schema <"+t+"> already exists with different definition");return this.schemas[r]}this.schemas[r]=t;var s=r.replace(/^([^#]*)#$/,"$1");this.schemas[s]=t}return this.addSubSchemaArray(i,t.items instanceof Array?t.items:[t.items]),this.addSubSchemaArray(i,t.extends instanceof Array?t.extends:[t.extends]),this.addSubSchema(i,t.additionalItems),this.addSubSchemaObject(i,t.properties),this.addSubSchema(i,t.additionalProperties),this.addSubSchemaObject(i,t.definitions),this.addSubSchemaObject(i,t.patternProperties),this.addSubSchemaObject(i,t.dependencies),this.addSubSchemaArray(i,t.disallow),this.addSubSchemaArray(i,t.allOf),this.addSubSchemaArray(i,t.anyOf),this.addSubSchemaArray(i,t.oneOf),this.addSubSchema(i,t.not),this.schemas[r]}var a=n.resolve(e,t.$ref);void 0===this.schemas[a]&&(this.schemas[a]=null,this.unresolvedRefs.push(a))}},c.prototype.addSubSchemaArray=function(e,t){if(t instanceof Array)for(var r=0;r",e);var c=o.objectGetPath(r.schemas[u],s.substr(1));if(void 0===c)throw new a("no such schema "+s+" located in <"+u+">",e);return{subschema:c,switchSchema:t}},c.prototype.testType=function(e,t,r,n,i){if("function"==typeof this.types[i])return this.types[i].call(this,e);if(i&&"object"==typeof i){var o=this.validateSchema(e,i,r,n);return void 0===o||!(o&&o.errors.length)}return!0};var d=c.prototype.types={};d.string=function(e){return"string"==typeof e},d.number=function(e){return"number"==typeof e&&isFinite(e)},d.integer=function(e){return"number"==typeof e&&e%1==0},d.boolean=function(e){return"boolean"==typeof e},d.array=function(e){return Array.isArray(e)},d.null=function(e){return null===e},d.date=function(e){return e instanceof Date},d.any=function(e){return!0},d.object=function(e){return e&&"object"==typeof e&&!(e instanceof Array)&&!(e instanceof Date)},e.exports=c},"../../node_modules/lodash/lodash.js":function(e,t,r){var n; +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */e=r.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=16,c=32,l=64,d=128,h=256,f=1/0,p=9007199254740991,m=NaN,g=4294967295,y=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",c],["partialRight",l],["rearg",h]],b="[object Arguments]",v="[object Array]",_="[object Boolean]",w="[object Date]",M="[object Error]",j="[object Function]",S="[object GeneratorFunction]",A="[object Map]",E="[object Number]",x="[object Object]",O="[object Promise]",T="[object RegExp]",P="[object Set]",k="[object String]",I="[object Symbol]",R="[object WeakMap]",N="[object ArrayBuffer]",C="[object DataView]",B="[object Float32Array]",L="[object Float64Array]",F="[object Int8Array]",D="[object Int16Array]",q="[object Int32Array]",U="[object Uint8Array]",z="[object Uint8ClampedArray]",V="[object Uint16Array]",$="[object Uint32Array]",H=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,X=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,J=/[&<>"']/g,G=RegExp(Z.source),W=RegExp(J.source),Y=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,re=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),se=/^\s+/,ae=/\s/,ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,be=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,_e=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Me=/($^)/,je=/['\n\r\u2028\u2029\\]/g,Se="\\ud800-\\udfff",Ae="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",Oe="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",Pe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="['’]",Ie="["+Se+"]",Re="["+Pe+"]",Ne="["+Ae+"]",Ce="\\d+",Be="["+Ee+"]",Le="["+xe+"]",Fe="[^"+Se+Pe+Ce+Ee+xe+Oe+"]",De="\\ud83c[\\udffb-\\udfff]",qe="[^"+Se+"]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",Ve="["+Oe+"]",$e="\\u200d",He="(?:"+Le+"|"+Fe+")",Ke="(?:"+Ve+"|"+Fe+")",Xe="(?:['’](?:d|ll|m|re|s|t|ve))?",Ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",Je="(?:"+Ne+"|"+De+")"+"?",Ge="["+Te+"]?",We=Ge+Je+("(?:"+$e+"(?:"+[qe,Ue,ze].join("|")+")"+Ge+Je+")*"),Ye="(?:"+[Be,Ue,ze].join("|")+")"+We,Qe="(?:"+[qe+Ne+"?",Ne,Ue,ze,Ie].join("|")+")",et=RegExp(ke,"g"),tt=RegExp(Ne,"g"),rt=RegExp(De+"(?="+De+")|"+Qe+We,"g"),nt=RegExp([Ve+"?"+Le+"+"+Xe+"(?="+[Re,Ve,"$"].join("|")+")",Ke+"+"+Ze+"(?="+[Re,Ve+He,"$"].join("|")+")",Ve+"?"+He+"+"+Xe,Ve+"+"+Ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ce,Ye].join("|"),"g"),it=RegExp("["+$e+Se+Ae+Te+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,st=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,ut={};ut[B]=ut[L]=ut[F]=ut[D]=ut[q]=ut[U]=ut[z]=ut[V]=ut[$]=!0,ut[b]=ut[v]=ut[N]=ut[_]=ut[C]=ut[w]=ut[M]=ut[j]=ut[A]=ut[E]=ut[x]=ut[T]=ut[P]=ut[k]=ut[R]=!1;var ct={};ct[b]=ct[v]=ct[N]=ct[C]=ct[_]=ct[w]=ct[B]=ct[L]=ct[F]=ct[D]=ct[q]=ct[A]=ct[E]=ct[x]=ct[T]=ct[P]=ct[k]=ct[I]=ct[U]=ct[z]=ct[V]=ct[$]=!0,ct[M]=ct[j]=ct[R]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},dt=parseFloat,ht=parseInt,ft="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,pt="object"==typeof self&&self&&self.Object===Object&&self,mt=ft||pt||Function("return this")(),gt=t&&!t.nodeType&&t,yt=gt&&e&&!e.nodeType&&e,bt=yt&&yt.exports===gt,vt=bt&&ft.process,_t=function(){try{var e=yt&&yt.require&&yt.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),wt=_t&&_t.isArrayBuffer,Mt=_t&&_t.isDate,jt=_t&&_t.isMap,St=_t&&_t.isRegExp,At=_t&&_t.isSet,Et=_t&&_t.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Ot(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function Nt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function nr(e,t){for(var r=e.length;r--&&Vt(t,e[r],0)>-1;);return r}var ir=Zt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),or=Zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sr(e){return"\\"+lt[e]}function ar(e){return it.test(e)}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function cr(e,t){return function(r){return e(t(r))}}function lr(e,t){for(var r=-1,n=e.length,i=0,o=[];++r",""":'"',"'":"'"});var yr=function e(t){var r,Array=(t=null==t?mt:yr.defaults(mt.Object(),t,yr.pick(mt,st))).Array,n=t.Date,ae=t.Error,Function=t.Function,Se=t.Math,Ae=t.Object,Ee=t.RegExp,xe=t.String,Oe=t.TypeError,Te=Array.prototype,Pe=Function.prototype,ke=Ae.prototype,Ie=t["__core-js_shared__"],Re=Pe.toString,Ne=ke.hasOwnProperty,Ce=0,Be=(r=/[^.]+$/.exec(Ie&&Ie.keys&&Ie.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Le=ke.toString,Fe=Re.call(Ae),De=mt._,qe=Ee("^"+Re.call(Ne).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=bt?t.Buffer:i,Ue=t.Symbol,ze=t.Uint8Array,Ve=Buffer?Buffer.allocUnsafe:i,$e=cr(Ae.getPrototypeOf,Ae),He=Ae.create,Ke=ke.propertyIsEnumerable,Xe=Te.splice,Ze=Ue?Ue.isConcatSpreadable:i,Je=Ue?Ue.iterator:i,Ge=Ue?Ue.toStringTag:i,We=function(){try{var e=co(Ae,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ye=t.clearTimeout!==mt.clearTimeout&&t.clearTimeout,Qe=n&&n.now!==mt.Date.now&&n.now,rt=t.setTimeout!==mt.setTimeout&&t.setTimeout,it=Se.ceil,lt=Se.floor,ft=Ae.getOwnPropertySymbols,pt=Buffer?Buffer.isBuffer:i,gt=t.isFinite,yt=Te.join,vt=cr(Ae.keys,Ae),_t=Se.max,qt=Se.min,Zt=n.now,br=t.parseInt,vr=Se.random,_r=Te.reverse,wr=co(t,"DataView"),Mr=co(t,"Map"),jr=co(t,"Promise"),Sr=co(t,"Set"),Ar=co(t,"WeakMap"),Er=co(Ae,"create"),xr=Ar&&new Ar,Or={},Tr=Bo(wr),Pr=Bo(Mr),kr=Bo(jr),Ir=Bo(Sr),Rr=Bo(Ar),Nr=Ue?Ue.prototype:i,Cr=Nr?Nr.valueOf:i,Br=Nr?Nr.toString:i;function Lr(e){if(Qs(e)&&!zs(e)&&!(e instanceof Ur)){if(e instanceof qr)return e;if(Ne.call(e,"__wrapped__"))return Lo(e)}return new qr(e)}var Fr=function(){function e(){}return function(t){if(!Ys(t))return{};if(He)return He(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function Dr(){}function qr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Ur(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sn(e,t,r,n,o,s){var a,u=1&t,c=2&t,l=4&t;if(r&&(a=o?r(e,n,o,s):r(e)),a!==i)return a;if(!Ys(e))return e;var d=zs(e);if(d){if(a=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Ne.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!u)return xi(e,a)}else{var h=fo(e),f=h==j||h==S;if(Ks(e))return wi(e,u);if(h==x||h==b||f&&!o){if(a=c||f?{}:mo(e),!u)return c?function(e,t){return Oi(e,ho(e),t)}(e,function(e,t){return e&&Oi(t,Pa(t),e)}(a,e)):function(e,t){return Oi(e,lo(e),t)}(e,tn(a,e))}else{if(!ct[h])return o?e:{};a=function(e,t,r){var n=e.constructor;switch(t){case N:return Mi(e);case _:case w:return new n(+e);case C:return function(e,t){var r=t?Mi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case B:case L:case F:case D:case q:case U:case z:case V:case $:return ji(e,r);case A:return new n;case E:case k:return new n(e);case T:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case P:return new n;case I:return i=e,Cr?Ae(Cr.call(i)):{}}var i}(e,h,u)}}s||(s=new Kr);var p=s.get(e);if(p)return p;s.set(e,a),ia(e)?e.forEach((function(n){a.add(sn(n,t,r,n,e,s))})):ea(e)&&e.forEach((function(n,i){a.set(i,sn(n,t,r,i,e,s))}));var m=d?i:(l?c?ro:to:c?Pa:Ta)(e);return Tt(m||e,(function(n,i){m&&(n=e[i=n]),Yr(a,i,sn(n,t,r,i,e,s))})),a}function an(e,t,r){var n=r.length;if(null==e)return!n;for(e=Ae(e);n--;){var o=r[n],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function un(e,t,r){if("function"!=typeof e)throw new Oe(o);return To((function(){e.apply(i,r)}),t)}function cn(e,t,r,n){var i=-1,o=Rt,s=!0,a=e.length,u=[],c=t.length;if(!a)return u;r&&(t=Ct(t,Qt(r))),n?(o=Nt,s=!1):t.length>=200&&(o=tr,s=!1,t=new Hr(t));e:for(;++i-1},Vr.prototype.set=function(e,t){var r=this.__data__,n=Qr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new zr,map:new(Mr||Vr),string:new zr}},$r.prototype.delete=function(e){var t=ao(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return ao(this,e).get(e)},$r.prototype.has=function(e){return ao(this,e).has(e)},$r.prototype.set=function(e,t){var r=ao(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Hr.prototype.add=Hr.prototype.push=function(e){return this.__data__.set(e,s),this},Hr.prototype.has=function(e){return this.__data__.has(e)},Kr.prototype.clear=function(){this.__data__=new Vr,this.size=0},Kr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Kr.prototype.get=function(e){return this.__data__.get(e)},Kr.prototype.has=function(e){return this.__data__.has(e)},Kr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Vr){var n=r.__data__;if(!Mr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(n)}return r.set(e,t),this.size=r.size,this};var ln=ki(bn),dn=ki(vn,!0);function hn(e,t){var r=!0;return ln(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function fn(e,t,r){for(var n=-1,o=e.length;++n0&&r(a)?t>1?mn(a,t-1,r,n,i):Bt(i,a):n||(i[i.length]=a)}return i}var gn=Ii(),yn=Ii(!0);function bn(e,t){return e&&gn(e,t,Ta)}function vn(e,t){return e&&yn(e,t,Ta)}function _n(e,t){return It(t,(function(t){return Js(e[t])}))}function wn(e,t){for(var r=0,n=(t=yi(t,e)).length;null!=e&&rt}function An(e,t){return null!=e&&Ne.call(e,t)}function En(e,t){return null!=e&&t in Ae(e)}function xn(e,t,r){for(var n=r?Nt:Rt,o=e[0].length,s=e.length,a=s,u=Array(s),c=1/0,l=[];a--;){var d=e[a];a&&t&&(d=Ct(d,Qt(t))),c=qt(d.length,c),u[a]=!r&&(t||o>=120&&d.length>=120)?new Hr(a&&d):i}d=e[0];var h=-1,f=u[0];e:for(;++h=a?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Vn(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)a!==e&&Xe.call(a,u,1),Xe.call(e,u,1);return e}function Hn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;yo(i)?Xe.call(e,i,1):ci(e,i)}}return e}function Kn(e,t){return e+lt(vr()*(t-e+1))}function Xn(e,t){var r="";if(!e||t<1||t>p)return r;do{t%2&&(r+=e),(t=lt(t/2))&&(e+=e)}while(t);return r}function Zn(e,t){return Po(Ao(e,t,tu),e+"")}function Jn(e){return Zr(Fa(e))}function Gn(e,t){var r=Fa(e);return Ro(r,on(t,0,r.length))}function Wn(e,t,r,n){if(!Ys(e))return e;for(var o=-1,s=(t=yi(t,e)).length,a=s-1,u=e;null!=u&&++oi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n>>1,s=e[o];null!==s&&!sa(s)&&(r?s<=t:s=200){var c=t?null:Xi(e);if(c)return dr(c);s=!1,i=tr,u=new Hr}else u=t?[]:a;e:for(;++n=n?e:ti(e,t,r)}var _i=Ye||function(e){return mt.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var r=e.length,n=Ve?Ve(r):new e.constructor(r);return e.copy(n),n}function Mi(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function ji(e,t){var r=t?Mi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,s=sa(e),a=t!==i,u=null===t,c=t==t,l=sa(t);if(!u&&!l&&!s&&e>t||s&&a&&c&&!u&&!l||n&&a&&c||!r&&c||!o)return 1;if(!n&&!s&&!l&&e1?r[o-1]:i,a=o>2?r[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&bo(r[0],r[1],a)&&(s=o<3?i:s,o=1),t=Ae(t);++n-1?o[s?t[a]:a]:i}}function Li(e){return eo((function(t){var r=t.length,n=r,s=qr.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new Oe(o);if(s&&!u&&"wrapper"==io(a))var u=new qr([],!0)}for(n=u?n:r;++n1&&v.reverse(),h&&cu))return!1;var l=s.get(e),d=s.get(t);if(l&&d)return l==t&&d==e;var h=-1,f=!0,p=2&r?new Hr:i;for(s.set(e,t),s.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ue,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Tt(y,(function(r){var n="_."+r[0];t&r[1]&&!Rt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(le):[]}(n),r)))}function Io(e){var t=0,r=0;return function(){var n=Zt(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Ro(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,ns(e,r)}));function ls(e){var t=Lr(e);return t.__chain__=!0,t}function ds(e,t){return t(e)}var hs=eo((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,o=function(t){return nn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ur&&yo(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:ds,args:[o],thisArg:i}),new qr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var fs=Ti((function(e,t,r){Ne.call(e,r)?++e[r]:rn(e,r,1)}));var ps=Bi(Uo),ms=Bi(zo);function gs(e,t){return(zs(e)?Tt:ln)(e,so(t,3))}function ys(e,t){return(zs(e)?Pt:dn)(e,so(t,3))}var bs=Ti((function(e,t,r){Ne.call(e,r)?e[r].push(t):rn(e,r,[t])}));var vs=Zn((function(e,t,r){var n=-1,i="function"==typeof t,o=$s(e)?Array(e.length):[];return ln(e,(function(e){o[++n]=i?xt(t,e,r):On(e,t,r)})),o})),_s=Ti((function(e,t,r){rn(e,r,t)}));function ws(e,t){return(zs(e)?Ct:Ln)(e,so(t,3))}var Ms=Ti((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var js=Zn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&bo(e,t[0],t[1])?t=[]:r>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),zn(e,mn(t,1),[])})),Ss=Qe||function(){return mt.Date.now()};function As(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Ji(e,d,i,i,i,i,t)}function Es(e,t){var r;if("function"!=typeof t)throw new Oe(o);return e=ha(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var xs=Zn((function(e,t,r){var n=1;if(r.length){var i=lr(r,oo(xs));n|=c}return Ji(e,n,t,r,i)})),Os=Zn((function(e,t,r){var n=3;if(r.length){var i=lr(r,oo(Os));n|=c}return Ji(t,n,e,r,i)}));function Ts(e,t,r){var n,s,a,u,c,l,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Oe(o);function m(t){var r=n,o=s;return n=s=i,d=t,u=e.apply(o,r)}function g(e){var r=e-l;return l===i||r>=t||r<0||f&&e-d>=a}function y(){var e=Ss();if(g(e))return b(e);c=To(y,function(e){var r=t-(e-l);return f?qt(r,a-(e-d)):r}(e))}function b(e){return c=i,p&&n?m(e):(n=s=i,u)}function v(){var e=Ss(),r=g(e);if(n=arguments,s=this,l=e,r){if(c===i)return function(e){return d=e,c=To(y,t),h?m(e):u}(l);if(f)return _i(c),c=To(y,t),m(l)}return c===i&&(c=To(y,t)),u}return t=pa(t)||0,Ys(r)&&(h=!!r.leading,a=(f="maxWait"in r)?_t(pa(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),v.cancel=function(){c!==i&&_i(c),d=0,n=l=s=c=i},v.flush=function(){return c===i?u:b(Ss())},v}var Ps=Zn((function(e,t){return un(e,1,t)})),ks=Zn((function(e,t,r){return un(e,pa(t)||0,r)}));function Is(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Oe(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Is.Cache||$r),r}function Rs(e){if("function"!=typeof e)throw new Oe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Is.Cache=$r;var Ns=bi((function(e,t){var r=(t=1==t.length&&zs(t[0])?Ct(t[0],Qt(so())):Ct(mn(t,1),Qt(so()))).length;return Zn((function(n){for(var i=-1,o=qt(n.length,r);++i=t})),Us=Tn(function(){return arguments}())?Tn:function(e){return Qs(e)&&Ne.call(e,"callee")&&!Ke.call(e,"callee")},zs=Array.isArray,Vs=wt?Qt(wt):function(e){return Qs(e)&&jn(e)==N};function $s(e){return null!=e&&Ws(e.length)&&!Js(e)}function Hs(e){return Qs(e)&&$s(e)}var Ks=pt||pu,Xs=Mt?Qt(Mt):function(e){return Qs(e)&&jn(e)==w};function Zs(e){if(!Qs(e))return!1;var t=jn(e);return t==M||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Js(e){if(!Ys(e))return!1;var t=jn(e);return t==j||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Gs(e){return"number"==typeof e&&e==ha(e)}function Ws(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=p}function Ys(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Qs(e){return null!=e&&"object"==typeof e}var ea=jt?Qt(jt):function(e){return Qs(e)&&fo(e)==A};function ta(e){return"number"==typeof e||Qs(e)&&jn(e)==E}function ra(e){if(!Qs(e)||jn(e)!=x)return!1;var t=$e(e);if(null===t)return!0;var r=Ne.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Re.call(r)==Fe}var na=St?Qt(St):function(e){return Qs(e)&&jn(e)==T};var ia=At?Qt(At):function(e){return Qs(e)&&fo(e)==P};function oa(e){return"string"==typeof e||!zs(e)&&Qs(e)&&jn(e)==k}function sa(e){return"symbol"==typeof e||Qs(e)&&jn(e)==I}var aa=Et?Qt(Et):function(e){return Qs(e)&&Ws(e.length)&&!!ut[jn(e)]};var ua=$i(Bn),ca=$i((function(e,t){return e<=t}));function la(e){if(!e)return[];if($s(e))return oa(e)?pr(e):xi(e);if(Je&&e[Je])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Je]());var t=fo(e);return(t==A?ur:t==P?dr:Fa)(e)}function da(e){return e?(e=pa(e))===f||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ha(e){var t=da(e),r=t%1;return t==t?r?t-r:t:0}function fa(e){return e?on(ha(e),0,g):0}function pa(e){if("number"==typeof e)return e;if(sa(e))return m;if(Ys(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ys(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=ye.test(e);return r||ve.test(e)?ht(e.slice(2),r?2:8):ge.test(e)?m:+e}function ma(e){return Oi(e,Pa(e))}function ga(e){return null==e?"":ai(e)}var ya=Pi((function(e,t){if(Mo(t)||$s(t))Oi(t,Ta(t),e);else for(var r in t)Ne.call(t,r)&&Yr(e,r,t[r])})),ba=Pi((function(e,t){Oi(t,Pa(t),e)})),va=Pi((function(e,t,r,n){Oi(t,Pa(t),e,n)})),_a=Pi((function(e,t,r,n){Oi(t,Ta(t),e,n)})),wa=eo(nn);var Ma=Zn((function(e,t){e=Ae(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&bo(t[0],t[1],o)&&(n=1);++r1),t})),Oi(e,ro(e),r),n&&(r=sn(r,7,Yi));for(var i=t.length;i--;)ci(r,t[i]);return r}));var Na=eo((function(e,t){return null==e?{}:function(e,t){return Vn(e,t,(function(t,r){return Aa(e,r)}))}(e,t)}));function Ca(e,t){if(null==e)return{};var r=Ct(ro(e),(function(e){return[e]}));return t=so(t),Vn(e,r,(function(e,r){return t(e,r[0])}))}var Ba=Zi(Ta),La=Zi(Pa);function Fa(e){return null==e?[]:er(e,Ta(e))}var Da=Ni((function(e,t,r){return t=t.toLowerCase(),e+(r?qa(t):t)}));function qa(e){return Za(ga(e).toLowerCase())}function Ua(e){return(e=ga(e))&&e.replace(we,ir).replace(tt,"")}var za=Ni((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Va=Ni((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),$a=Ri("toLowerCase");var Ha=Ni((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Ka=Ni((function(e,t,r){return e+(r?" ":"")+Za(t)}));var Xa=Ni((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Za=Ri("toUpperCase");function Ja(e,t,r){return e=ga(e),(t=r?i:t)===i?function(e){return ot.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var Ga=Zn((function(e,t){try{return xt(e,i,t)}catch(e){return Zs(e)?e:new ae(e)}})),Wa=eo((function(e,t){return Tt(t,(function(t){t=Co(t),rn(e,t,xs(e[t],e))})),e}));function Ya(e){return function(){return e}}var Qa=Li(),eu=Li(!0);function tu(e){return e}function ru(e){return Rn("function"==typeof e?e:sn(e,1))}var nu=Zn((function(e,t){return function(r){return On(r,e,t)}})),iu=Zn((function(e,t){return function(r){return On(e,r,t)}}));function ou(e,t,r){var n=Ta(t),i=_n(t,n);null!=r||Ys(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=_n(t,Ta(t)));var o=!(Ys(r)&&"chain"in r&&!r.chain),s=Js(e);return Tt(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=xi(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Bt([this.value()],arguments))})})),e}function su(){}var au=Ui(Ct),uu=Ui(kt),cu=Ui(Dt);function lu(e){return vo(e)?Xt(Co(e)):function(e){return function(t){return wn(t,e)}}(e)}var du=Vi(),hu=Vi(!0);function fu(){return[]}function pu(){return!1}var mu=qi((function(e,t){return e+t}),0),gu=Ki("ceil"),yu=qi((function(e,t){return e/t}),1),bu=Ki("floor");var vu,_u=qi((function(e,t){return e*t}),1),wu=Ki("round"),Mu=qi((function(e,t){return e-t}),0);return Lr.after=function(e,t){if("function"!=typeof t)throw new Oe(o);return e=ha(e),function(){if(--e<1)return t.apply(this,arguments)}},Lr.ary=As,Lr.assign=ya,Lr.assignIn=ba,Lr.assignInWith=va,Lr.assignWith=_a,Lr.at=wa,Lr.before=Es,Lr.bind=xs,Lr.bindAll=Wa,Lr.bindKey=Os,Lr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return zs(e)?e:[e]},Lr.chain=ls,Lr.chunk=function(e,t,r){t=(r?bo(e,t,r):t===i)?1:_t(ha(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var o=0,s=0,a=Array(it(n/t));oo?0:o+r),(n=n===i||n>o?o:ha(n))<0&&(n+=o),n=r>n?0:fa(n);r>>0)?(e=ga(e))&&("string"==typeof t||null!=t&&!na(t))&&!(t=ai(t))&&ar(e)?vi(pr(e),0,r):e.split(t,r):[]},Lr.spread=function(e,t){if("function"!=typeof e)throw new Oe(o);return t=null==t?0:_t(ha(t),0),Zn((function(r){var n=r[t],i=vi(r,0,t);return n&&Bt(i,n),xt(e,this,i)}))},Lr.tail=function(e){var t=null==e?0:e.length;return t?ti(e,1,t):[]},Lr.take=function(e,t,r){return e&&e.length?ti(e,0,(t=r||t===i?1:ha(t))<0?0:t):[]},Lr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ti(e,(t=n-(t=r||t===i?1:ha(t)))<0?0:t,n):[]},Lr.takeRightWhile=function(e,t){return e&&e.length?di(e,so(t,3),!1,!0):[]},Lr.takeWhile=function(e,t){return e&&e.length?di(e,so(t,3)):[]},Lr.tap=function(e,t){return t(e),e},Lr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new Oe(o);return Ys(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Ts(e,t,{leading:n,maxWait:t,trailing:i})},Lr.thru=ds,Lr.toArray=la,Lr.toPairs=Ba,Lr.toPairsIn=La,Lr.toPath=function(e){return zs(e)?Ct(e,Co):sa(e)?[e]:xi(No(ga(e)))},Lr.toPlainObject=ma,Lr.transform=function(e,t,r){var n=zs(e),i=n||Ks(e)||aa(e);if(t=so(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Ys(e)&&Js(o)?Fr($e(e)):{}}return(i?Tt:bn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Lr.unary=function(e){return As(e,1)},Lr.union=Qo,Lr.unionBy=es,Lr.unionWith=ts,Lr.uniq=function(e){return e&&e.length?ui(e):[]},Lr.uniqBy=function(e,t){return e&&e.length?ui(e,so(t,2)):[]},Lr.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ui(e,i,t):[]},Lr.unset=function(e,t){return null==e||ci(e,t)},Lr.unzip=rs,Lr.unzipWith=ns,Lr.update=function(e,t,r){return null==e?e:li(e,t,gi(r))},Lr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:li(e,t,gi(r),n)},Lr.values=Fa,Lr.valuesIn=function(e){return null==e?[]:er(e,Pa(e))},Lr.without=is,Lr.words=Ja,Lr.wrap=function(e,t){return Cs(gi(t),e)},Lr.xor=os,Lr.xorBy=ss,Lr.xorWith=as,Lr.zip=us,Lr.zipObject=function(e,t){return pi(e||[],t||[],Yr)},Lr.zipObjectDeep=function(e,t){return pi(e||[],t||[],Wn)},Lr.zipWith=cs,Lr.entries=Ba,Lr.entriesIn=La,Lr.extend=ba,Lr.extendWith=va,ou(Lr,Lr),Lr.add=mu,Lr.attempt=Ga,Lr.camelCase=Da,Lr.capitalize=qa,Lr.ceil=gu,Lr.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=pa(r))==r?r:0),t!==i&&(t=(t=pa(t))==t?t:0),on(pa(e),t,r)},Lr.clone=function(e){return sn(e,4)},Lr.cloneDeep=function(e){return sn(e,5)},Lr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:i)},Lr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:i)},Lr.conformsTo=function(e,t){return null==t||an(e,t,Ta(t))},Lr.deburr=Ua,Lr.defaultTo=function(e,t){return null==e||e!=e?t:e},Lr.divide=yu,Lr.endsWith=function(e,t,r){e=ga(e),t=ai(t);var n=e.length,o=r=r===i?n:on(ha(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},Lr.eq=Fs,Lr.escape=function(e){return(e=ga(e))&&W.test(e)?e.replace(J,or):e},Lr.escapeRegExp=function(e){return(e=ga(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Lr.every=function(e,t,r){var n=zs(e)?kt:hn;return r&&bo(e,t,r)&&(t=i),n(e,so(t,3))},Lr.find=ps,Lr.findIndex=Uo,Lr.findKey=function(e,t){return Ut(e,so(t,3),bn)},Lr.findLast=ms,Lr.findLastIndex=zo,Lr.findLastKey=function(e,t){return Ut(e,so(t,3),vn)},Lr.floor=bu,Lr.forEach=gs,Lr.forEachRight=ys,Lr.forIn=function(e,t){return null==e?e:gn(e,so(t,3),Pa)},Lr.forInRight=function(e,t){return null==e?e:yn(e,so(t,3),Pa)},Lr.forOwn=function(e,t){return e&&bn(e,so(t,3))},Lr.forOwnRight=function(e,t){return e&&vn(e,so(t,3))},Lr.get=Sa,Lr.gt=Ds,Lr.gte=qs,Lr.has=function(e,t){return null!=e&&po(e,t,An)},Lr.hasIn=Aa,Lr.head=$o,Lr.identity=tu,Lr.includes=function(e,t,r,n){e=$s(e)?e:Fa(e),r=r&&!n?ha(r):0;var i=e.length;return r<0&&(r=_t(i+r,0)),oa(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Vt(e,t,r)>-1},Lr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ha(r);return i<0&&(i=_t(n+i,0)),Vt(e,t,i)},Lr.inRange=function(e,t,r){return t=da(t),r===i?(r=t,t=0):r=da(r),function(e,t,r){return e>=qt(t,r)&&e<_t(t,r)}(e=pa(e),t,r)},Lr.invoke=Oa,Lr.isArguments=Us,Lr.isArray=zs,Lr.isArrayBuffer=Vs,Lr.isArrayLike=$s,Lr.isArrayLikeObject=Hs,Lr.isBoolean=function(e){return!0===e||!1===e||Qs(e)&&jn(e)==_},Lr.isBuffer=Ks,Lr.isDate=Xs,Lr.isElement=function(e){return Qs(e)&&1===e.nodeType&&!ra(e)},Lr.isEmpty=function(e){if(null==e)return!0;if($s(e)&&(zs(e)||"string"==typeof e||"function"==typeof e.splice||Ks(e)||aa(e)||Us(e)))return!e.length;var t=fo(e);if(t==A||t==P)return!e.size;if(Mo(e))return!Nn(e).length;for(var r in e)if(Ne.call(e,r))return!1;return!0},Lr.isEqual=function(e,t){return Pn(e,t)},Lr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?Pn(e,t,i,r):!!n},Lr.isError=Zs,Lr.isFinite=function(e){return"number"==typeof e&>(e)},Lr.isFunction=Js,Lr.isInteger=Gs,Lr.isLength=Ws,Lr.isMap=ea,Lr.isMatch=function(e,t){return e===t||kn(e,t,uo(t))},Lr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,kn(e,t,uo(t),r)},Lr.isNaN=function(e){return ta(e)&&e!=+e},Lr.isNative=function(e){if(wo(e))throw new ae("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return In(e)},Lr.isNil=function(e){return null==e},Lr.isNull=function(e){return null===e},Lr.isNumber=ta,Lr.isObject=Ys,Lr.isObjectLike=Qs,Lr.isPlainObject=ra,Lr.isRegExp=na,Lr.isSafeInteger=function(e){return Gs(e)&&e>=-9007199254740991&&e<=p},Lr.isSet=ia,Lr.isString=oa,Lr.isSymbol=sa,Lr.isTypedArray=aa,Lr.isUndefined=function(e){return e===i},Lr.isWeakMap=function(e){return Qs(e)&&fo(e)==R},Lr.isWeakSet=function(e){return Qs(e)&&"[object WeakSet]"==jn(e)},Lr.join=function(e,t){return null==e?"":yt.call(e,t)},Lr.kebabCase=za,Lr.last=Zo,Lr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=ha(r))<0?_t(n+o,0):qt(o,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):zt(e,Ht,o,!0)},Lr.lowerCase=Va,Lr.lowerFirst=$a,Lr.lt=ua,Lr.lte=ca,Lr.max=function(e){return e&&e.length?fn(e,tu,Sn):i},Lr.maxBy=function(e,t){return e&&e.length?fn(e,so(t,2),Sn):i},Lr.mean=function(e){return Kt(e,tu)},Lr.meanBy=function(e,t){return Kt(e,so(t,2))},Lr.min=function(e){return e&&e.length?fn(e,tu,Bn):i},Lr.minBy=function(e,t){return e&&e.length?fn(e,so(t,2),Bn):i},Lr.stubArray=fu,Lr.stubFalse=pu,Lr.stubObject=function(){return{}},Lr.stubString=function(){return""},Lr.stubTrue=function(){return!0},Lr.multiply=_u,Lr.nth=function(e,t){return e&&e.length?Un(e,ha(t)):i},Lr.noConflict=function(){return mt._===this&&(mt._=De),this},Lr.noop=su,Lr.now=Ss,Lr.pad=function(e,t,r){e=ga(e);var n=(t=ha(t))?fr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return zi(lt(i),r)+e+zi(it(i),r)},Lr.padEnd=function(e,t,r){e=ga(e);var n=(t=ha(t))?fr(e):0;return t&&nt){var n=e;e=t,t=n}if(r||e%1||t%1){var o=vr();return qt(e+o*(t-e+dt("1e-"+((o+"").length-1))),t)}return Kn(e,t)},Lr.reduce=function(e,t,r){var n=zs(e)?Lt:Jt,i=arguments.length<3;return n(e,so(t,4),r,i,ln)},Lr.reduceRight=function(e,t,r){var n=zs(e)?Ft:Jt,i=arguments.length<3;return n(e,so(t,4),r,i,dn)},Lr.repeat=function(e,t,r){return t=(r?bo(e,t,r):t===i)?1:ha(t),Xn(ga(e),t)},Lr.replace=function(){var e=arguments,t=ga(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Lr.result=function(e,t,r){var n=-1,o=(t=yi(t,e)).length;for(o||(o=1,e=i);++np)return[];var r=g,n=qt(e,g);t=so(t),e-=g;for(var i=Wt(n,t);++r=s)return e;var u=r-fr(n);if(u<1)return n;var c=a?vi(a,0,u).join(""):e.slice(0,u);if(o===i)return c+n;if(a&&(u+=c.length-u),na(o)){if(e.slice(u).search(o)){var l,d=c;for(o.global||(o=Ee(o.source,ga(me.exec(o))+"g")),o.lastIndex=0;l=o.exec(d);)var h=l.index;c=c.slice(0,h===i?u:h)}}else if(e.indexOf(ai(o),u)!=u){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+n},Lr.unescape=function(e){return(e=ga(e))&&G.test(e)?e.replace(Z,gr):e},Lr.uniqueId=function(e){var t=++Ce;return ga(e)+t},Lr.upperCase=Xa,Lr.upperFirst=Za,Lr.each=gs,Lr.eachRight=ys,Lr.first=$o,ou(Lr,(vu={},bn(Lr,(function(e,t){Ne.call(Lr.prototype,t)||(vu[t]=e)})),vu),{chain:!1}),Lr.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Lr[e].placeholder=Lr})),Tt(["drop","take"],(function(e,t){Ur.prototype[e]=function(r){r=r===i?1:_t(ha(r),0);var n=this.__filtered__&&!t?new Ur(this):this.clone();return n.__filtered__?n.__takeCount__=qt(r,n.__takeCount__):n.__views__.push({size:qt(r,g),type:e+(n.__dir__<0?"Right":"")}),n},Ur.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Ur.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:so(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Ur.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Ur.prototype[e]=function(){return this.__filtered__?new Ur(this):this[r](1)}})),Ur.prototype.compact=function(){return this.filter(tu)},Ur.prototype.find=function(e){return this.filter(e).head()},Ur.prototype.findLast=function(e){return this.reverse().find(e)},Ur.prototype.invokeMap=Zn((function(e,t){return"function"==typeof e?new Ur(this):this.map((function(r){return On(r,e,t)}))})),Ur.prototype.reject=function(e){return this.filter(Rs(so(e)))},Ur.prototype.slice=function(e,t){e=ha(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Ur(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=ha(t))<0?r.dropRight(-t):r.take(t-e)),r)},Ur.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ur.prototype.toArray=function(){return this.take(g)},bn(Ur.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Lr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);o&&(Lr.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,u=t instanceof Ur,c=a[0],l=u||zs(t),d=function(e){var t=o.apply(Lr,Bt([e],a));return n&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,f=!!this.__actions__.length,p=s&&!h,m=u&&!f;if(!s&&l){t=m?t:new Ur(this);var g=e.apply(t,a);return g.__actions__.push({func:ds,args:[d],thisArg:i}),new qr(g,h)}return p&&m?e.apply(this,a):(g=this.thru(d),p?n?g.value()[0]:g.value():g)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Te[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Lr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(zs(i)?i:[],e)}return this[r]((function(r){return t.apply(zs(r)?r:[],e)}))}})),bn(Ur.prototype,(function(e,t){var r=Lr[t];if(r){var n=r.name+"";Ne.call(Or,n)||(Or[n]=[]),Or[n].push({name:t,func:r})}})),Or[Fi(i,2).name]=[{name:"wrapper",func:i}],Ur.prototype.clone=function(){var e=new Ur(this.__wrapped__);return e.__actions__=xi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=xi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=xi(this.__views__),e},Ur.prototype.reverse=function(){if(this.__filtered__){var e=new Ur(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ur.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=zs(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Lr.prototype.plant=function(e){for(var t,r=this;r instanceof Dr;){var n=Lo(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},Lr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ur){var t=e;return this.__actions__.length&&(t=new Ur(this)),(t=t.reverse()).__actions__.push({func:ds,args:[Yo],thisArg:i}),new qr(t,this.__chain__)}return this.thru(Yo)},Lr.prototype.toJSON=Lr.prototype.valueOf=Lr.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},Lr.prototype.first=Lr.prototype.head,Je&&(Lr.prototype[Je]=function(){return this}),Lr}();mt._=yr,(n=function(){return yr}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},"../../node_modules/md5.js/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/hash-base/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function a(e,t){return e<>>32-t}function u(e,t,r,n,i,o,s){return a(e+(t&r|~t&n)+i+o|0,s)+t|0}function c(e,t,r,n,i,o,s){return a(e+(t&n|r&~n)+i+o|0,s)+t|0}function l(e,t,r,n,i,o,s){return a(e+(t^r^n)+i+o|0,s)+t|0}function d(e,t,r,n,i,o,s){return a(e+(r^(t|~n))+i+o|0,s)+t|0}n(s,i),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,s=this._d;r=u(r,n,i,s,e[0],3614090360,7),s=u(s,r,n,i,e[1],3905402710,12),i=u(i,s,r,n,e[2],606105819,17),n=u(n,i,s,r,e[3],3250441966,22),r=u(r,n,i,s,e[4],4118548399,7),s=u(s,r,n,i,e[5],1200080426,12),i=u(i,s,r,n,e[6],2821735955,17),n=u(n,i,s,r,e[7],4249261313,22),r=u(r,n,i,s,e[8],1770035416,7),s=u(s,r,n,i,e[9],2336552879,12),i=u(i,s,r,n,e[10],4294925233,17),n=u(n,i,s,r,e[11],2304563134,22),r=u(r,n,i,s,e[12],1804603682,7),s=u(s,r,n,i,e[13],4254626195,12),i=u(i,s,r,n,e[14],2792965006,17),r=c(r,n=u(n,i,s,r,e[15],1236535329,22),i,s,e[1],4129170786,5),s=c(s,r,n,i,e[6],3225465664,9),i=c(i,s,r,n,e[11],643717713,14),n=c(n,i,s,r,e[0],3921069994,20),r=c(r,n,i,s,e[5],3593408605,5),s=c(s,r,n,i,e[10],38016083,9),i=c(i,s,r,n,e[15],3634488961,14),n=c(n,i,s,r,e[4],3889429448,20),r=c(r,n,i,s,e[9],568446438,5),s=c(s,r,n,i,e[14],3275163606,9),i=c(i,s,r,n,e[3],4107603335,14),n=c(n,i,s,r,e[8],1163531501,20),r=c(r,n,i,s,e[13],2850285829,5),s=c(s,r,n,i,e[2],4243563512,9),i=c(i,s,r,n,e[7],1735328473,14),r=l(r,n=c(n,i,s,r,e[12],2368359562,20),i,s,e[5],4294588738,4),s=l(s,r,n,i,e[8],2272392833,11),i=l(i,s,r,n,e[11],1839030562,16),n=l(n,i,s,r,e[14],4259657740,23),r=l(r,n,i,s,e[1],2763975236,4),s=l(s,r,n,i,e[4],1272893353,11),i=l(i,s,r,n,e[7],4139469664,16),n=l(n,i,s,r,e[10],3200236656,23),r=l(r,n,i,s,e[13],681279174,4),s=l(s,r,n,i,e[0],3936430074,11),i=l(i,s,r,n,e[3],3572445317,16),n=l(n,i,s,r,e[6],76029189,23),r=l(r,n,i,s,e[9],3654602809,4),s=l(s,r,n,i,e[12],3873151461,11),i=l(i,s,r,n,e[15],530742520,16),r=d(r,n=l(n,i,s,r,e[2],3299628645,23),i,s,e[0],4096336452,6),s=d(s,r,n,i,e[7],1126891415,10),i=d(i,s,r,n,e[14],2878612391,15),n=d(n,i,s,r,e[5],4237533241,21),r=d(r,n,i,s,e[12],1700485571,6),s=d(s,r,n,i,e[3],2399980690,10),i=d(i,s,r,n,e[10],4293915773,15),n=d(n,i,s,r,e[1],2240044497,21),r=d(r,n,i,s,e[8],1873313359,6),s=d(s,r,n,i,e[15],4264355552,10),i=d(i,s,r,n,e[6],2734768916,15),n=d(n,i,s,r,e[13],1309151649,21),r=d(r,n,i,s,e[4],4149444226,6),s=d(s,r,n,i,e[11],3174756917,10),i=d(i,s,r,n,e[2],718787259,15),n=d(n,i,s,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+s|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Buffer.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},"../../node_modules/miller-rabin/lib/mr.js":(e,t,r)=>{var n=r("../../node_modules/miller-rabin/node_modules/bn.js/lib/bn.js"),i=r("../../node_modules/brorand/index.js");function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),s=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var a=e.subn(1),u=0;!a.testn(u);u++);for(var c=e.shrn(u),l=a.toRed(o);t>0;t--){var d=this._randrange(new n(2),a);r&&r(d);var h=d.toRed(o).redPow(c);if(0!==h.cmp(s)&&0!==h.cmp(l)){for(var f=1;f0;t--){var l=this._randrange(new n(2),s),d=e.gcd(l);if(0!==d.cmpn(1))return d;var h=l.toRed(i).redPow(u);if(0!==h.cmp(o)&&0!==h.cmp(c)){for(var f=1;f=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=a(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],_=8191&v,w=v>>>13,M=0|s[4],j=8191&M,S=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,O=0|s[6],T=8191&O,P=O>>>13,k=0|s[7],I=8191&k,R=k>>>13,N=0|s[8],C=8191&N,B=N>>>13,L=0|s[9],F=8191&L,D=L>>>13,q=0|a[0],U=8191&q,z=q>>>13,V=0|a[1],$=8191&V,H=V>>>13,K=0|a[2],X=8191&K,Z=K>>>13,J=0|a[3],G=8191&J,W=J>>>13,Y=0|a[4],Q=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],de=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(h,U)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(m,U)|0,o=Math.imul(m,z);var ye=(c+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(b,U)|0,o=Math.imul(b,z),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var be=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var ve=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,z))+Math.imul(S,U)|0,o=Math.imul(S,z),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,W)|0;var _e=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(x,U)|0,o=Math.imul(x,z),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var we=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var Me=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(R,U)|0,o=Math.imul(R,z),n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var je=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,H)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Se=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(D,U)|0,o=Math.imul(D,z),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,H)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Ae=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,H))+Math.imul(D,$)|0,o=Math.imul(D,H),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,he)|0;var Ee=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,Z))+Math.imul(D,X)|0,o=Math.imul(D,Z),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,he)|0;var xe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,G),i=(i=Math.imul(F,W))+Math.imul(D,G)|0,o=Math.imul(D,W),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,he)|0;var Te=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(T,de)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,he)|0;var Pe=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,oe),i=(i=Math.imul(F,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(R,de)|0,o=o+Math.imul(R,he)|0;var ke=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,ce))+Math.imul(D,ue)|0,o=Math.imul(D,ce),n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,he)|0;var Ie=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,de),i=(i=Math.imul(F,he))+Math.imul(D,de)|0,o=Math.imul(D,he);var Re=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(c+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(D,pe)|0))<<13)|0;return c=((o=Math.imul(D,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=_e,u[5]=we,u[6]=Me,u[7]=je,u[8]=Se,u[9]=Ae,u[10]=Ee,u[11]=xe,u[12]=Oe,u[13]=Te,u[14]=Pe,u[15]=ke,u[16]=Ie,u[17]=Re,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new M(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function j(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new j(e)},i(j,M),j.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},j.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},j.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},j.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},j.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/minimalistic-assert/index.js":e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},"../../node_modules/minimalistic-crypto-utils/lib/utils.js":(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},"../../node_modules/object-is/implementation.js":e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},"../../node_modules/object-is/index.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/define-properties/index.js"),i=r("../../node_modules/call-bind/index.js"),o=r("../../node_modules/object-is/implementation.js"),s=r("../../node_modules/object-is/polyfill.js"),a=r("../../node_modules/object-is/shim.js"),u=i(s(),Object);n(u,{getPolyfill:s,implementation:o,shim:a}),e.exports=u},"../../node_modules/object-is/polyfill.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/object-is/implementation.js");e.exports=function(){return"function"==typeof Object.is?Object.is:n}},"../../node_modules/object-is/shim.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/object-is/polyfill.js"),i=r("../../node_modules/define-properties/index.js");e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},"../../node_modules/object-keys/implementation.js":(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r("../../node_modules/object-keys/isArguments.js"),a=Object.prototype.propertyIsEnumerable,u=!a.call({toString:null},"toString"),c=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=s(e),a=t&&"[object String]"===o.call(e),h=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var m=0;m0)for(var g=0;g{"use strict";var n=Array.prototype.slice,i=r("../../node_modules/object-keys/isArguments.js"),o=Object.keys,s=o?function(e){return o(e)}:r("../../node_modules/object-keys/implementation.js"),a=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(n.call(e)):a(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},"../../node_modules/object-keys/isArguments.js":e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},"../../node_modules/parse-asn1/asn1.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/asn1.js/lib/asn1.js");t.certificate=r("../../node_modules/parse-asn1/certificate.js");var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));t.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=o;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));t.PublicKey=s;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=u;var c=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));t.EncryptedPrivateKey=c;var l=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));t.DSAPrivateKey=l,t.DSAparam=n.define("DSAparam",(function(){this.int()}));var d=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=d;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},"../../node_modules/parse-asn1/certificate.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/asn1.js/lib/asn1.js"),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(u)})),l=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),d=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),f=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(l),this.key("validity").use(d),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(f),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));e.exports=p},"../../node_modules/parse-asn1/fixProc.js":(e,t,r)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=r("../../node_modules/evp_bytestokey/index.js"),a=r("../../node_modules/browserify-aes/browser.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e,t){var r,u=e.toString(),c=u.match(n);if(c){var l="aes"+c[1],d=Buffer.from(c[2],"hex"),h=Buffer.from(c[3].replace(/[\r\n]/g,""),"base64"),f=s(t,d.slice(0,8),parseInt(c[1],10)).key,p=[],m=a.createDecipheriv(l,f,d);p.push(m.update(h)),p.push(m.final()),r=Buffer.concat(p)}else{var g=u.match(o);r=Buffer.from(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(i)[1],data:r}}},"../../node_modules/parse-asn1/index.js":(e,t,r)=>{var n=r("../../node_modules/parse-asn1/asn1.js"),i=r("../../node_modules/parse-asn1/aesid.json"),o=r("../../node_modules/parse-asn1/fixProc.js"),s=r("../../node_modules/browserify-aes/browser.js"),a=r("../../node_modules/pbkdf2/browser.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function u(e){var t;"object"!=typeof e||Buffer.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=Buffer.from(e));var r,u,c=o(e,t),l=c.tag,d=c.data;switch(l){case"CERTIFICATE":u=n.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=n.PublicKey.decode(d,"der")),r=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=n.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":d=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[e.algorithm.decrypt.cipher.algo.join(".")],u=e.algorithm.decrypt.cipher.iv,c=e.subjectPrivateKey,l=parseInt(o.split("-")[1],10)/8,d=a.pbkdf2Sync(t,r,n,l,"sha1"),h=s.createDecipheriv(o,d,u),f=[];return f.push(h.update(c)),f.push(h.final()),Buffer.concat(f)}(d=n.EncryptedPrivateKey.decode(d,"der"),t);case"PRIVATE KEY":switch(r=(u=n.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:n.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=n.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=n.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+l)}}e.exports=u,u.signature=n.signature},"../../node_modules/pbkdf2/browser.js":(e,t,r)=>{t.pbkdf2=r("../../node_modules/pbkdf2/lib/async.js"),t.pbkdf2Sync=r("../../node_modules/pbkdf2/lib/sync-browser.js")},"../../node_modules/pbkdf2/lib/async.js":(e,t,r)=>{var n,i,o=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=r("../../node_modules/pbkdf2/lib/precondition.js"),a=r("../../node_modules/pbkdf2/lib/default-encoding.js"),u=r("../../node_modules/pbkdf2/lib/sync-browser.js"),c=r("../../node_modules/pbkdf2/lib/to-buffer.js"),l=r.g.crypto&&r.g.crypto.subtle,d={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function f(){return i||(i=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function p(e,t,r,n,i){return l.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return l.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)})).then((function(e){return Buffer.from(e)}))}e.exports=function(e,t,i,m,g,y){"function"==typeof g&&(y=g,g=void 0);var b=d[(g=g||"sha1").toLowerCase()];if(b&&"function"==typeof r.g.Promise){if(s(i,m),e=c(e,a,"Password"),t=c(t,a,"Salt"),"function"!=typeof y)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){f()((function(){t(null,e)}))}),(function(e){f()((function(){t(e)}))}))}(function(e){if(r.g.process&&!r.g.process.browser)return o.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return o.resolve(!1);if(void 0!==h[e])return h[e];var t=p(n=n||Buffer.alloc(8),n,10,128,e).then((function(){return!0})).catch((function(){return!1}));return h[e]=t,t}(b).then((function(r){return r?p(e,t,i,m,b):u(e,t,i,m,g)})),y)}else f()((function(){var r;try{r=u(e,t,i,m,g)}catch(e){return y(e)}y(null,r)}))}},"../../node_modules/pbkdf2/lib/default-encoding.js":(e,t,r)=>{var n,i=r("../../node_modules/process/browser.js");if(r.g.process&&r.g.process.browser)n="utf-8";else if(r.g.process&&r.g.process.version){n=parseInt(i.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";e.exports=n},"../../node_modules/pbkdf2/lib/precondition.js":e=>{var t=Math.pow(2,30)-1;e.exports=function(e,r){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>t||r!=r)throw new TypeError("Bad key length")}},"../../node_modules/pbkdf2/lib/sync-browser.js":(e,t,r)=>{var n=r("../../node_modules/create-hash/md5.js"),i=r("../../node_modules/ripemd160/index.js"),o=r("../../node_modules/sha.js/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=r("../../node_modules/pbkdf2/lib/precondition.js"),a=r("../../node_modules/pbkdf2/lib/default-encoding.js"),u=r("../../node_modules/pbkdf2/lib/to-buffer.js"),c=Buffer.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(e,t,r){var s=function(e){function t(t){return o(e).update(t).digest()}function r(e){return(new i).update(e).digest()}return"rmd160"===e||"ripemd160"===e?r:"md5"===e?n:t}(e),a="sha512"===e||"sha384"===e?128:64;t.length>a?t=s(t):t.length{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e,t,r){if(Buffer.isBuffer(e))return e;if("string"==typeof e)return Buffer.from(e,t);if(ArrayBuffer.isView(e))return Buffer.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},"../../node_modules/process/browser.js":e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,l=-1;function d(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=s(d);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l1)for(var r=1;r{t.publicEncrypt=r("../../node_modules/public-encrypt/publicEncrypt.js"),t.privateDecrypt=r("../../node_modules/public-encrypt/privateDecrypt.js"),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},"../../node_modules/public-encrypt/mgf.js":(e,t,r)=>{var n=r("../../node_modules/create-hash/browser.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function i(e){var t=Buffer.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){for(var r,o=Buffer.alloc(0),s=0;o.length=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=a(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==Buffer),this.toArrayLike(Buffer,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],_=8191&v,w=v>>>13,M=0|s[4],j=8191&M,S=M>>>13,A=0|s[5],E=8191&A,x=A>>>13,O=0|s[6],T=8191&O,P=O>>>13,k=0|s[7],I=8191&k,R=k>>>13,N=0|s[8],C=8191&N,B=N>>>13,L=0|s[9],F=8191&L,D=L>>>13,q=0|a[0],U=8191&q,z=q>>>13,V=0|a[1],$=8191&V,H=V>>>13,K=0|a[2],X=8191&K,Z=K>>>13,J=0|a[3],G=8191&J,W=J>>>13,Y=0|a[4],Q=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],de=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(h,U)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(m,U)|0,o=Math.imul(m,z);var ye=(c+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(b,U)|0,o=Math.imul(b,z),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var be=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var ve=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,z))+Math.imul(S,U)|0,o=Math.imul(S,z),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,W)|0;var _e=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,z))+Math.imul(x,U)|0,o=Math.imul(x,z),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var we=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(P,U)|0,o=Math.imul(P,z),n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var Me=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,se)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(R,U)|0,o=Math.imul(R,z),n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var je=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,z))+Math.imul(B,U)|0,o=Math.imul(B,z),n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,H)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Se=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,z))+Math.imul(D,U)|0,o=Math.imul(D,z),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,H)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,se)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,he)|0;var Ae=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,H))+Math.imul(D,$)|0,o=Math.imul(D,H),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,he)|0;var Ee=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,X),i=(i=Math.imul(F,Z))+Math.imul(D,X)|0,o=Math.imul(D,Z),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(w,de)|0,o=o+Math.imul(w,he)|0;var xe=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,G),i=(i=Math.imul(F,W))+Math.imul(D,G)|0,o=Math.imul(D,W),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(D,Q)|0,o=Math.imul(D,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,he)|0;var Te=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(T,de)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,he)|0;var Pe=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,oe),i=(i=Math.imul(F,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(I,de)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(R,de)|0,o=o+Math.imul(R,he)|0;var ke=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(F,ue),i=(i=Math.imul(F,ce))+Math.imul(D,ue)|0,o=Math.imul(D,ce),n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,he)|0;var Ie=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,de),i=(i=Math.imul(F,he))+Math.imul(D,de)|0,o=Math.imul(D,he);var Re=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(c+(n=Math.imul(F,pe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(D,pe)|0))<<13)|0;return c=((o=Math.imul(D,me))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=_e,u[5]=we,u[6]=Me,u[7]=je,u[8]=Se,u[9]=Ae,u[10]=Ee,u[11]=xe,u[12]=Oe,u[13]=Te,u[14]=Pe,u[15]=ke,u[16]=Ie,u[17]=Re,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(f=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new M(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function j(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return g[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new j(e)},i(j,M),j.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},j.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},j.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},j.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},j.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},"../../node_modules/public-encrypt/privateDecrypt.js":(e,t,r)=>{var n=r("../../node_modules/parse-asn1/index.js"),i=r("../../node_modules/public-encrypt/mgf.js"),o=r("../../node_modules/public-encrypt/xor.js"),s=r("../../node_modules/public-encrypt/node_modules/bn.js/lib/bn.js"),a=r("../../node_modules/browserify-rsa/index.js"),u=r("../../node_modules/create-hash/browser.js"),c=r("../../node_modules/public-encrypt/withPublic.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e,t,r){var l;l=e.padding?e.padding:r?1:4;var d,h=n(e),f=h.modulus.byteLength();if(t.length>f||new s(t).cmp(h.modulus)>=0)throw new Error("decryption error");d=r?c(new s(t),h):a(t,h);var p=Buffer.alloc(f-d.length);if(d=Buffer.concat([p,d],f),4===l)return function(e,t){var r=e.modulus.byteLength(),n=u("sha1").update(Buffer.alloc(0)).digest(),s=n.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,s+1),c=t.slice(s+1),l=o(a,i(c,s)),d=o(c,i(l,r-s-1));if(function(e,t){e=Buffer.from(e),t=Buffer.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var s=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,d,r);if(3===l)return d;throw new Error("unknown padding")}},"../../node_modules/public-encrypt/publicEncrypt.js":(e,t,r)=>{var n=r("../../node_modules/parse-asn1/index.js"),i=r("../../node_modules/randombytes/browser.js"),o=r("../../node_modules/create-hash/browser.js"),s=r("../../node_modules/public-encrypt/mgf.js"),a=r("../../node_modules/public-encrypt/xor.js"),u=r("../../node_modules/public-encrypt/node_modules/bn.js/lib/bn.js"),c=r("../../node_modules/public-encrypt/withPublic.js"),l=r("../../node_modules/browserify-rsa/index.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e,t,r){var d;d=e.padding?e.padding:r?1:4;var h,f=n(e);if(4===d)h=function(e,t){var r=e.modulus.byteLength(),n=t.length,c=o("sha1").update(Buffer.alloc(0)).digest(),l=c.length,d=2*l;if(n>r-d-2)throw new Error("message too long");var h=Buffer.alloc(r-n-d-2),f=r-l-1,p=i(l),m=a(Buffer.concat([c,h,Buffer.alloc(1,1),t],f),s(p,f)),g=a(p,s(m,l));return new u(Buffer.concat([Buffer.alloc(1),g,m],r))}(f,t);else if(1===d)h=function(e,t,r){var n,o=t.length,s=e.modulus.byteLength();if(o>s-11)throw new Error("message too long");n=r?Buffer.alloc(s-o-3,255):function(e){var t,r=Buffer.allocUnsafe(e),n=0,o=i(2*e),s=0;for(;n=0)throw new Error("data too long for modulus")}return r?l(h,f):c(h,f)}},"../../node_modules/public-encrypt/withPublic.js":(e,t,r)=>{var n=r("../../node_modules/public-encrypt/node_modules/bn.js/lib/bn.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;e.exports=function(e,t){return Buffer.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},"../../node_modules/public-encrypt/xor.js":e=>{e.exports=function(e,t){for(var r=e.length,n=-1;++n{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,i){r=r||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(r);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var u=e.length;a>0&&u>a&&(u=a);for(var c=0;c=0?(l=p.substr(0,m),d=p.substr(m+1)):(l=p,d=""),h=decodeURIComponent(l),f=decodeURIComponent(d),t(o,h)?Array.isArray(o[h])?o[h].push(f):o[h]=[o[h],f]:o[h]=f}return o}},"../../node_modules/querystring/encode.js":e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,i){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+n;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(r):o+encodeURIComponent(t(e[i]))})).join(r):i?encodeURIComponent(t(i))+n+encodeURIComponent(t(e)):""}},"../../node_modules/querystring/index.js":(e,t,r)=>{"use strict";t.decode=t.parse=r("../../node_modules/querystring/decode.js"),t.encode=t.stringify=r("../../node_modules/querystring/encode.js")},"../../node_modules/randombytes/browser.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/process/browser.js"),i=65536,o=4294967295;var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var r=Buffer.allocUnsafe(e);if(e>0)if(e>i)for(var a=0;a{"use strict";var n=r("../../node_modules/process/browser.js");function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r("../../node_modules/safe-buffer/index.js"),s=r("../../node_modules/randombytes/browser.js"),Buffer=o.Buffer,a=o.kMaxLength,u=r.g.crypto||r.g.msCrypto,c=Math.pow(2,32)-1;function l(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>c||e<0)throw new TypeError("offset must be a uint32");if(e>a||e>t)throw new RangeError("offset out of range")}function d(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>c||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>a)throw new RangeError("buffer too small")}function h(e,t,r,i){if(n.browser){var o=e.buffer,a=new Uint8Array(o,t,r);return u.getRandomValues(a),i?void n.nextTick((function(){i(null,e)})):e}if(!i)return s(r).copy(e,t),e;s(r,(function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)}))}u&&u.getRandomValues||!n.browser?(t.randomFill=function(e,t,n,i){if(!(Buffer.isBuffer(e)||e instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)i=t,t=0,n=e.length;else if("function"==typeof n)i=n,n=e.length-t;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(t,e.length),d(n,t,e.length),h(e,t,n,i)},t.randomFillSync=function(e,t,n){void 0===t&&(t=0);if(!(Buffer.isBuffer(e)||e instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(t,e.length),void 0===n&&(n=e.length-t);return d(n,t,e.length),h(e,t,n)}):(t.randomFill=i,t.randomFillSync=i)},"../../node_modules/readable-stream/errors-browser.js":e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s,a;if("string"==typeof t&&(o="not ",t.substr(!s||s<0?0:+s,o.length)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(u," ").concat(i," ").concat(n(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},"../../node_modules/readable-stream/lib/_stream_duplex.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/process/browser.js"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r("../../node_modules/readable-stream/lib/_stream_readable.js"),s=r("../../node_modules/readable-stream/lib/_stream_writable.js");r("../../node_modules/inherits/inherits_browser.js")(l,o);for(var a=i(s.prototype),u=0;u{"use strict";e.exports=i;var n=r("../../node_modules/readable-stream/lib/_stream_transform.js");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r("../../node_modules/inherits/inherits_browser.js")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},"../../node_modules/readable-stream/lib/_stream_readable.js":(e,t,r)=>{"use strict";var n,i=r("../../node_modules/process/browser.js");e.exports=S,S.ReadableState=j;r("../../node_modules/events/events.js").EventEmitter;var o=function(e,t){return e.listeners(t).length},s=r("../../node_modules/readable-stream/lib/internal/streams/stream-browser.js"),Buffer=r("../../node_modules/buffer/index.js").Buffer,a=r.g.Uint8Array||function(){};var u,c=r("?983a");u=c&&c.debuglog?c.debuglog("stream"):function(){};var l,d,h,f=r("../../node_modules/readable-stream/lib/internal/streams/buffer_list.js"),p=r("../../node_modules/readable-stream/lib/internal/streams/destroy.js"),m=r("../../node_modules/readable-stream/lib/internal/streams/state.js").getHighWaterMark,g=r("../../node_modules/readable-stream/errors-browser.js").q,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,v=g.ERR_METHOD_NOT_IMPLEMENTED,_=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r("../../node_modules/inherits/inherits_browser.js")(S,s);var w=p.errorOrDestroy,M=["error","close","destroy","pause","resume"];function j(e,t,i){n=n||r("../../node_modules/readable-stream/lib/_stream_duplex.js"),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",i),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r("../../node_modules/string_decoder/lib/string_decoder.js").s),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r("../../node_modules/readable-stream/lib/_stream_duplex.js"),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new j(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function A(e,t,r,n,i){u("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,P(e)))}(e,s);else if(i||(o=function(e,t){var r;n=t,Buffer.isBuffer(n)||n instanceof a||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(s,t)),o)w(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===Buffer.prototype||(t=function(e){return Buffer.from(e)}(t)),n)s.endEmitted?w(e,new _):E(e,s,t,!0);else if(s.ended)w(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?E(e,s,t,!1):k(e,s)):E(e,s,t,!1)}else n||(s.reading=!1,k(e,s));return!s.ended&&(s.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=x?e=x:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(P,e))}function P(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function k(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(I,e,t))}function I(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){u("readable nexttick read 0"),e.read(0)}function C(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function F(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(D,t,e))}function D(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function q(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):T(this),null;if(0===(e=O(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,i=t.needReadable;return u("need readable",i),(0===t.length||t.length-e0?L(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},S.prototype._read=function(e){w(this,new v("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var s=(!t||!1!==t.end)&&e!==i.stdout&&e!==i.stderr?c:g;function a(t,i){u("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",g),r.removeListener("data",h),d=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){u("onend"),e.end()}n.endEmitted?i.nextTick(s):r.once("end",s),e.on("unpipe",a);var l=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",l);var d=!1;function h(t){u("ondata");var i=e.write(t);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==q(n.pipes,e))&&!d&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){u("onerror",t),g(),e.removeListener("error",f),0===o(e,"error")&&w(e,t)}function p(){e.removeListener("finish",m),g()}function m(){u("onfinish"),e.removeListener("close",p),g()}function g(){u("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",p),e.once("finish",m),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?T(this):n.reading||i.nextTick(N,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(R,this),r},S.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(R,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(C,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(u("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o{"use strict";e.exports=l;var n=r("../../node_modules/readable-stream/errors-browser.js").q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r("../../node_modules/readable-stream/lib/_stream_duplex.js");function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";var n,i=r("../../node_modules/process/browser.js");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=S,S.WritableState=j;var s={deprecate:r("../../node_modules/util-deprecate/browser.js")},a=r("../../node_modules/readable-stream/lib/internal/streams/stream-browser.js"),Buffer=r("../../node_modules/buffer/index.js").Buffer,u=r.g.Uint8Array||function(){};var c,l=r("../../node_modules/readable-stream/lib/internal/streams/destroy.js"),d=r("../../node_modules/readable-stream/lib/internal/streams/state.js").getHighWaterMark,h=r("../../node_modules/readable-stream/errors-browser.js").q,f=h.ERR_INVALID_ARG_TYPE,p=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_MULTIPLE_CALLBACK,g=h.ERR_STREAM_CANNOT_PIPE,y=h.ERR_STREAM_DESTROYED,b=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,_=h.ERR_UNKNOWN_ENCODING,w=l.errorOrDestroy;function M(){}function j(e,t,s){n=n||r("../../node_modules/readable-stream/lib/_stream_duplex.js"),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(P,e,t),e._writableState.errorEmitted=!0,w(e,n)):(o(n),e._writableState.errorEmitted=!0,w(e,n),P(e,t))}(e,r,n,t,o);else{var s=O(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),n?i.nextTick(E,e,r,s,o):E(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function S(e){var t=this instanceof(n=n||r("../../node_modules/readable-stream/lib/_stream_duplex.js"));if(!t&&!c.call(S,this))return new S(e);this._writableState=new j(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function A(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function E(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),P(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,A(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,d=r.callback;if(A(e,t,!1,t.objectMode?1:c.length,c,l,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function O(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final((function(r){t.pendingcb--,r&&w(e,r),t.prefinished=!0,e.emit("prefinish"),P(e,t)}))}function P(e,t){var r=O(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r("../../node_modules/inherits/inherits_browser.js")(S,a),j.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(j.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===S&&(e&&e._writableState instanceof j)}})):c=function(e){return e instanceof this},S.prototype.pipe=function(){w(this,new g)},S.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,Buffer.isBuffer(n)||n instanceof u);return a&&!Buffer.isBuffer(e)&&(e=function(e){return Buffer.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=M),o.ending?function(e,t){var r=new v;w(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new b:"string"==typeof r||t.objectMode||(o=new f("chunk",["string","Buffer"],r)),!o||(w(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=Buffer.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new p("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,P(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=l.destroy,S.prototype._undestroy=l.undestroy,S.prototype._destroy=function(e,t){t(e)}},"../../node_modules/readable-stream/lib/internal/streams/async_iterator.js":(e,t,r)=>{"use strict";var n,i=r("../../node_modules/process/browser.js"),o=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r("../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js"),u=Symbol("lastResolve"),c=Symbol("lastReject"),l=Symbol("error"),d=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function m(e,t){return{value:e,done:t}}function g(e){var t=e[u];if(null!==t){var r=e[p].read();null!==r&&(e[h]=null,e[u]=null,e[c]=null,t(m(r,!1)))}}function y(e){i.nextTick(g,e)}var b=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((s(n={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(null!==t)return o.reject(t);if(this[d])return o.resolve(m(void 0,!0));if(this[p].destroyed)return new o((function(t,r){i.nextTick((function(){e[l]?r(e[l]):t(m(void 0,!0))}))}));var r,n=this[h];if(n)r=new o(function(e,t){return function(r,n){e.then((function(){t[d]?r(m(void 0,!0)):t[f](r,n)}),n)}}(n,this));else{var s=this[p].read();if(null!==s)return o.resolve(m(s,!1));r=new o(this[f])}return this[h]=r,r}},Symbol.asyncIterator,(function(){return this})),s(n,"return",(function(){var e=this;return new o((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(m(void 0,!0))}))}))})),n),b);e.exports=function(e){var t,r=Object.create(v,(s(t={},p,{value:e,writable:!0}),s(t,u,{value:null,writable:!0}),s(t,c,{value:null,writable:!0}),s(t,l,{value:null,writable:!0}),s(t,d,{value:e._readableState.endEmitted,writable:!0}),s(t,f,{value:function(e,t){var n=r[p].read();n?(r[h]=null,r[u]=null,r[c]=null,e(m(n,!1))):(r[u]=e,r[c]=t)},writable:!0}),t));return r[h]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[c];return null!==t&&(r[h]=null,r[u]=null,r[c]=null,t(e)),void(r[l]=e)}var n=r[u];null!==n&&(r[h]=null,r[u]=null,r[c]=null,n(m(void 0,!0))),r[d]=!0})),e.on("readable",y.bind(null,r)),r}},"../../node_modules/readable-stream/lib/internal/streams/buffer_list.js":(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return Buffer.alloc(0);for(var t,r,n,i=Buffer.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,Buffer.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=Buffer.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:a,value:function(e,t){return s(this,function(e){for(var t=1;t{"use strict";var n=r("../../node_modules/process/browser.js");function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},"../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/readable-stream/errors-browser.js").q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},"../../node_modules/readable-stream/lib/internal/streams/pipeline.js":(e,t,r)=>{"use strict";var n;var i=r("../../node_modules/readable-stream/errors-browser.js").q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i0,(function(e){l||(l=e),e&&h.forEach(u),o||(h.forEach(u),d(l))}))}));return t.reduce(c)}},"../../node_modules/readable-stream/lib/internal/streams/state.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/readable-stream/errors-browser.js").q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},"../../node_modules/readable-stream/lib/internal/streams/stream-browser.js":(e,t,r)=>{e.exports=r("../../node_modules/events/events.js").EventEmitter},"../../node_modules/readable-stream/readable-browser.js":(e,t,r)=>{(t=e.exports=r("../../node_modules/readable-stream/lib/_stream_readable.js")).Stream=t,t.Readable=t,t.Writable=r("../../node_modules/readable-stream/lib/_stream_writable.js"),t.Duplex=r("../../node_modules/readable-stream/lib/_stream_duplex.js"),t.Transform=r("../../node_modules/readable-stream/lib/_stream_transform.js"),t.PassThrough=r("../../node_modules/readable-stream/lib/_stream_passthrough.js"),t.finished=r("../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js"),t.pipeline=r("../../node_modules/readable-stream/lib/internal/streams/pipeline.js")},"../../node_modules/ripemd160/index.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/hash-base/index.js"),o=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],a=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],c=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function h(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function f(e,t){return e<>>32-t}function p(e,t,r,n,i,o,s,a){return f(e+(t^r^n)+o+s|0,a)+i|0}function m(e,t,r,n,i,o,s,a){return f(e+(t&r|~t&n)+o+s|0,a)+i|0}function g(e,t,r,n,i,o,s,a){return f(e+((t|~r)^n)+o+s|0,a)+i|0}function y(e,t,r,n,i,o,s,a){return f(e+(t&n|r&~n)+o+s|0,a)+i|0}function b(e,t,r,n,i,o,s,a){return f(e+(t^(r|~n))+o+s|0,a)+i|0}n(h,i),h.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,h=0|this._d,v=0|this._e,_=0|this._a,w=0|this._b,M=0|this._c,j=0|this._d,S=0|this._e,A=0;A<80;A+=1){var E,x;A<16?(E=p(r,n,i,h,v,e[s[A]],l[0],u[A]),x=b(_,w,M,j,S,e[a[A]],d[0],c[A])):A<32?(E=m(r,n,i,h,v,e[s[A]],l[1],u[A]),x=y(_,w,M,j,S,e[a[A]],d[1],c[A])):A<48?(E=g(r,n,i,h,v,e[s[A]],l[2],u[A]),x=g(_,w,M,j,S,e[a[A]],d[2],c[A])):A<64?(E=y(r,n,i,h,v,e[s[A]],l[3],u[A]),x=m(_,w,M,j,S,e[a[A]],d[3],c[A])):(E=b(r,n,i,h,v,e[s[A]],l[4],u[A]),x=p(_,w,M,j,S,e[a[A]],d[4],c[A])),r=v,v=h,h=f(i,10),i=n,n=E,_=S,S=j,j=f(M,10),M=w,w=x}var O=this._b+i+j|0;this._b=this._c+h+S|0,this._c=this._d+v+_|0,this._d=this._e+r+w|0,this._e=this._a+n+M|0,this._a=O},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Buffer.alloc?Buffer.alloc(20):new Buffer(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},"../../node_modules/ripple-address-codec/dist/index.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.isValidXAddress=t.decodeXAddress=t.xAddressToClassicAddress=t.encodeXAddress=t.classicAddressToXAddress=t.isValidClassicAddress=t.decodeAccountPublic=t.encodeAccountPublic=t.decodeNodePublic=t.encodeNodePublic=t.decodeAccountID=t.encodeAccountID=t.decodeSeed=t.encodeSeed=t.codec=void 0;const n=r("../../node_modules/assert/build/assert.js"),i=r("../../node_modules/ripple-address-codec/dist/xrp-codec.js");Object.defineProperty(t,"codec",{enumerable:!0,get:function(){return i.codec}}),Object.defineProperty(t,"encodeSeed",{enumerable:!0,get:function(){return i.encodeSeed}}),Object.defineProperty(t,"decodeSeed",{enumerable:!0,get:function(){return i.decodeSeed}}),Object.defineProperty(t,"encodeAccountID",{enumerable:!0,get:function(){return i.encodeAccountID}}),Object.defineProperty(t,"decodeAccountID",{enumerable:!0,get:function(){return i.decodeAccountID}}),Object.defineProperty(t,"encodeNodePublic",{enumerable:!0,get:function(){return i.encodeNodePublic}}),Object.defineProperty(t,"decodeNodePublic",{enumerable:!0,get:function(){return i.decodeNodePublic}}),Object.defineProperty(t,"encodeAccountPublic",{enumerable:!0,get:function(){return i.encodeAccountPublic}}),Object.defineProperty(t,"decodeAccountPublic",{enumerable:!0,get:function(){return i.decodeAccountPublic}}),Object.defineProperty(t,"isValidClassicAddress",{enumerable:!0,get:function(){return i.isValidClassicAddress}});const o={main:Buffer.from([5,68]),test:Buffer.from([4,147])},s=4294967295;function a(e,t,r){if(20!==e.length)throw new Error("Account ID must be 20 bytes");if(t>s)throw new Error("Invalid tag");const n=t||0,a=!1===t||null==t?0:1,u=Buffer.concat([r?o.test:o.main,e,Buffer.from([a,255&n,n>>8&255,n>>16&255,n>>24&255,0,0,0,0])]);return i.codec.encodeChecked(u)}function u(e){const t=i.codec.decodeChecked(e),r=function(e){const t=e.slice(0,2);if(o.main.equals(t))return!1;if(o.test.equals(t))return!0;throw new Error("Invalid X-address: bad prefix")}(t);return{accountId:t.slice(2,22),tag:function(e){const t=e[22];if(t>=2)throw new Error("Unsupported X-address");if(1===t)return e[23]+256*e[24]+65536*e[25]+16777216*e[26];return n.strictEqual(t,0,"flag must be zero to indicate no tag"),n.ok(Buffer.from("0000000000000000","hex").equals(e.slice(23,31)),"remaining bytes must be zero"),!1}(t),test:r}}t.classicAddressToXAddress=function(e,t,r){return a((0,i.decodeAccountID)(e),t,r)},t.encodeXAddress=a,t.xAddressToClassicAddress=function(e){const{accountId:t,tag:r,test:n}=u(e);return{classicAddress:(0,i.encodeAccountID)(t),tag:r,test:n}},t.decodeXAddress=u,t.isValidXAddress=function(e){try{u(e)}catch(e){return!1}return!0}},"../../node_modules/ripple-address-codec/dist/utils.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatArgs=t.seqEqual=void 0,t.seqEqual=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r{if("number"!=typeof e)for(const r of e)t.push(r);else t.push(e)})),t}},"../../node_modules/ripple-address-codec/dist/xrp-codec.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.isValidClassicAddress=t.decodeAccountPublic=t.encodeAccountPublic=t.encodeNodePublic=t.decodeNodePublic=t.decodeAddress=t.decodeAccountID=t.encodeAddress=t.encodeAccountID=t.decodeSeed=t.encodeSeed=t.codec=void 0;const n=r("../../node_modules/base-x/src/index.js"),i=r("../../node_modules/create-hash/browser.js"),o=r("../../node_modules/ripple-address-codec/dist/utils.js");const s=0,a=[1,225,75],u={sha256:e=>i("sha256").update(Buffer.from(e)).digest(),alphabet:"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"},c=new class{constructor(e){this._sha256=e.sha256,this._alphabet=e.alphabet,this._codec=n(this._alphabet)}encode(e,t){const r=t.versions;return this._encodeVersioned(e,r,t.expectedLength)}decode(e,t){var r;const n=t.versions,i=t.versionTypes,s=this.decodeChecked(e);if(n.length>1&&!t.expectedLength)throw new Error("expectedLength is required because there are >= 2 possible versions");const a="number"==typeof n[0]?1:n[0].length,u=null!==(r=t.expectedLength)&&void 0!==r?r:s.length-a,c=s.slice(0,-u),l=s.slice(-u);for(let e=0;e= 5");if(!this._verifyCheckSum(t))throw new Error("checksum_invalid");return t.slice(0,-4)}_encodeVersioned(e,t,r){if(r&&e.length!==r)throw new Error("unexpected_payload_length: bytes.length does not match expectedLength. Ensure that the bytes are a Buffer.");return this.encodeChecked(Buffer.from((0,o.concatArgs)(t,e)))}_encodeRaw(e){return this._codec.encode(e)}_decodeRaw(e){return this._codec.decode(e)}_verifyCheckSum(e){const t=this._sha256(this._sha256(e.slice(0,-4))).slice(0,4),r=e.slice(-4);return(0,o.seqEqual)(t,r)}}(u);function l(e){const t={versions:[s],expectedLength:20};return c.encode(e,t)}function d(e){const t={versions:[s],expectedLength:20};return c.decode(e,t).bytes}t.codec=c,t.encodeSeed=function(e,t){if(16!==e.length)throw new Error("entropy must have length 16");const r={expectedLength:16,versions:"ed25519"===t?a:[33]};return c.encode(e,r)},t.decodeSeed=function(e,t={versionTypes:["ed25519","secp256k1"],versions:[a,33],expectedLength:16}){return c.decode(e,t)},t.encodeAccountID=l,t.encodeAddress=l,t.decodeAccountID=d,t.decodeAddress=d,t.decodeNodePublic=function(e){const t={versions:[28],expectedLength:33};return c.decode(e,t).bytes},t.encodeNodePublic=function(e){const t={versions:[28],expectedLength:33};return c.encode(e,t)},t.encodeAccountPublic=function(e){const t={versions:[35],expectedLength:33};return c.encode(e,t)},t.decodeAccountPublic=function(e){const t={versions:[35],expectedLength:33};return c.decode(e,t).bytes},t.isValidClassicAddress=function(e){try{d(e)}catch(e){return!1}return!0}},"../../node_modules/ripple-binary-codec/dist/binary.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transactionID=t.sha512Half=t.binaryToJSON=t.signingClaimData=t.signingData=t.multiSigningData=t.readJSON=t.serializeObject=t.makeParser=t.BytesList=t.BinarySerializer=t.BinaryParser=void 0;var n=r("../../node_modules/ripple-binary-codec/dist/types/index.js"),i=r("../../node_modules/ripple-binary-codec/dist/serdes/binary-parser.js");Object.defineProperty(t,"BinaryParser",{enumerable:!0,get:function(){return i.BinaryParser}});var o=r("../../node_modules/ripple-binary-codec/dist/hash-prefixes.js"),s=r("../../node_modules/ripple-binary-codec/dist/serdes/binary-serializer.js");Object.defineProperty(t,"BinarySerializer",{enumerable:!0,get:function(){return s.BinarySerializer}}),Object.defineProperty(t,"BytesList",{enumerable:!0,get:function(){return s.BytesList}});var a=r("../../node_modules/ripple-binary-codec/dist/hashes.js");Object.defineProperty(t,"sha512Half",{enumerable:!0,get:function(){return a.sha512Half}}),Object.defineProperty(t,"transactionID",{enumerable:!0,get:function(){return a.transactionID}});var u=r("../../node_modules/big-integer/BigInteger.js"),c=function(e){return new i.BinaryParser(e)};t.makeParser=c;var l=function(e){return e.readType(n.coreTypes.STObject).toJSON()};t.readJSON=l;function d(e,t){void 0===t&&(t={});var r=t.prefix,i=t.suffix,o=t.signingFieldsOnly,a=void 0!==o&&o,u=new s.BytesList;r&&u.put(r);var c=a?function(e){return e.isSigningField}:void 0;return n.coreTypes.STObject.from(e,c).toBytesSink(u),i&&u.put(i),u.toBytes()}t.binaryToJSON=function(e){return l(c(e))},t.serializeObject=d,t.signingData=function(e,t){return void 0===t&&(t=o.HashPrefix.transactionSig),d(e,{prefix:t,signingFieldsOnly:!0})},t.signingClaimData=function(e){var t=u(String(e.amount)),r=o.HashPrefix.paymentChannelClaim,i=n.coreTypes.Hash256.from(e.channel).toBytes(),a=n.coreTypes.UInt64.from(t).toBytes(),c=new s.BytesList;return c.put(r),c.put(i),c.put(a),c.toBytes()},t.multiSigningData=function(e,t){return d(e,{prefix:o.HashPrefix.transactionMultiSig,suffix:n.coreTypes.AccountID.from(t).toBytes(),signingFieldsOnly:!0})}},"../../node_modules/ripple-binary-codec/dist/coretypes.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.types=t.ShaMap=t.HashPrefix=t.quality=t.TransactionResult=t.Type=t.LedgerEntryType=t.TransactionType=t.Field=t.ledgerHashes=t.binary=t.hashes=void 0;var n=r("../../node_modules/ripple-binary-codec/dist/enums/index.js");Object.defineProperty(t,"Field",{enumerable:!0,get:function(){return n.Field}}),Object.defineProperty(t,"TransactionType",{enumerable:!0,get:function(){return n.TransactionType}}),Object.defineProperty(t,"LedgerEntryType",{enumerable:!0,get:function(){return n.LedgerEntryType}}),Object.defineProperty(t,"Type",{enumerable:!0,get:function(){return n.Type}}),Object.defineProperty(t,"TransactionResult",{enumerable:!0,get:function(){return n.TransactionResult}});var i=r("../../node_modules/ripple-binary-codec/dist/types/index.js");t.types=i;var o=r("../../node_modules/ripple-binary-codec/dist/binary.js");t.binary=o;var s=r("../../node_modules/ripple-binary-codec/dist/shamap.js");Object.defineProperty(t,"ShaMap",{enumerable:!0,get:function(){return s.ShaMap}});var a=r("../../node_modules/ripple-binary-codec/dist/ledger-hashes.js");t.ledgerHashes=a;var u=r("../../node_modules/ripple-binary-codec/dist/hashes.js");t.hashes=u;var c=r("../../node_modules/ripple-binary-codec/dist/quality.js");Object.defineProperty(t,"quality",{enumerable:!0,get:function(){return c.quality}});var l=r("../../node_modules/ripple-binary-codec/dist/hash-prefixes.js");Object.defineProperty(t,"HashPrefix",{enumerable:!0,get:function(){return l.HashPrefix}})},"../../node_modules/ripple-binary-codec/dist/enums/index.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionType=t.TransactionResult=t.LedgerEntryType=t.Type=t.Field=t.Bytes=t.TRANSACTION_TYPES=void 0;var n=r("../../node_modules/ripple-binary-codec/dist/enums/definitions.json"),i=r("../../node_modules/ripple-binary-codec/dist/types/serialized-type.js"),o=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js");t.TRANSACTION_TYPES=Object.entries(n.TRANSACTION_TYPES).filter((function(e){e[0];return e[1]>=0})).map((function(e){var t=e[0];e[1];return t}));var s=function(){function e(e,t,r){this.name=e,this.ordinal=t,this.ordinalWidth=r,this.bytes=o.Buffer.alloc(r);for(var n=0;n>>8*n&255}return e.prototype.toJSON=function(){return this.name},e.prototype.toBytesSink=function(e){e.put(this.bytes)},e.prototype.toBytes=function(){return this.bytes},e}();t.Bytes=s;var a=function(){function e(e,t){var r=this;this.ordinalWidth=t,Object.entries(e).forEach((function(e){var n=e[0],i=e[1];r[n]=new s(n,i,t),r[i.toString()]=r[n]}))}return e.prototype.from=function(e){return e instanceof s?e:this[e]},e.prototype.fromParser=function(e){return this.from(e.readUIntN(this.ordinalWidth).toString())},e}();function u(e){var t,r,a,u=e[0],c=e[1],l=n.TYPES[c.type],d=(t=l,r=c.nth,a=[],t<16?r<16?a.push(t<<4|r):a.push(t<<4,r):r<16?a.push(r,t):a.push(0,t,r),o.Buffer.from(a));return{name:u,nth:c.nth,isVariableLengthEncoded:c.isVLEncoded,isSerialized:c.isSerialized,isSigningField:c.isSigningField,ordinal:l<<16|c.nth,type:new s(c.type,l,2),header:d,associatedType:i.SerializedType}}var c=function(){function e(e){var t=this;e.forEach((function(e){var r=e[0],n=e[1];t[r]=u([r,n]),t[t[r].ordinal.toString()]=t[r]}))}return e.prototype.fromString=function(e){return this[e]},e}(),l=new a(n.TYPES,2);t.Type=l;var d=new a(n.LEDGER_ENTRY_TYPES,2);t.LedgerEntryType=d;var h=new a(n.TRANSACTION_TYPES,2);t.TransactionType=h;var f=new a(n.TRANSACTION_RESULTS,1);t.TransactionResult=f;var p=new c(n.FIELDS);t.Field=p},"../../node_modules/ripple-binary-codec/dist/hash-prefixes.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashPrefix=void 0;var n=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js");function i(e){var t=n.Buffer.alloc(4);return t.writeUInt32BE(e,0),t}var o={transactionID:i(1415073280),transaction:i(1397638144),accountStateEntry:i(1296846336),innerNode:i(1296649728),ledgerHeader:i(1280791040),transactionSig:i(1398036480),transactionMultiSig:i(1397576704),validation:i(1447119872),proposal:i(1347571712),paymentChannelClaim:i(1129073920)};t.HashPrefix=o},"../../node_modules/ripple-binary-codec/dist/hashes.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.transactionID=t.sha512Half=t.Sha512Half=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/hash-prefixes.js"),s=r("../../node_modules/create-hash/browser.js"),a=r("../../node_modules/ripple-binary-codec/dist/types/hash-256.js"),u=r("../../node_modules/ripple-binary-codec/dist/serdes/binary-serializer.js"),c=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hash=s("sha512"),t}return i(t,e),t.put=function(e){return(new t).put(e)},t.prototype.put=function(e){return this.hash.update(e),this},t.prototype.finish256=function(){return c.Buffer.from(this.hash.digest().slice(0,32))},t.prototype.finish=function(){return new a.Hash256(this.finish256())},t}(u.BytesList);function d(){for(var e=[],t=0;t{"use strict";var n=r("../../node_modules/assert/build/assert.js"),i=r("../../node_modules/ripple-binary-codec/dist/coretypes.js"),o=r("../../node_modules/ripple-binary-codec/dist/ledger-hashes.js"),s=r("../../node_modules/ripple-binary-codec/dist/enums/index.js"),a=i.binary.signingData,u=i.binary.signingClaimData,c=i.binary.multiSigningData,l=i.binary.binaryToJSON,d=i.binary.serializeObject;e.exports={decode:function(e){return n.ok("string"==typeof e,"binary must be a hex string"),l(e)},encode:function(e){return n.ok("object"==typeof e),d(e).toString("hex").toUpperCase()},encodeForSigning:function(e){return n.ok("object"==typeof e),a(e).toString("hex").toUpperCase()},encodeForSigningClaim:function(e){return n.ok("object"==typeof e),u(e).toString("hex").toUpperCase()},encodeForMultisigning:function(e,t){return n.ok("object"==typeof e),n.equal(e.SigningPubKey,""),c(e,t).toString("hex").toUpperCase()},encodeQuality:function(e){return n.ok("string"==typeof e),i.quality.encode(e).toString("hex").toUpperCase()},decodeQuality:function(e){return n.ok("string"==typeof e),i.quality.decode(e).toString()},decodeLedgerData:o.decodeLedgerData,TRANSACTION_TYPES:s.TRANSACTION_TYPES}},"../../node_modules/ripple-binary-codec/dist/ledger-hashes.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeLedgerData=t.ledgerHash=t.transactionTreeHash=t.accountStateHash=void 0;var n=r("../../node_modules/assert/build/assert.js"),i=r("../../node_modules/ripple-binary-codec/dist/shamap.js"),o=r("../../node_modules/ripple-binary-codec/dist/hash-prefixes.js"),s=r("../../node_modules/ripple-binary-codec/dist/hashes.js"),a=r("../../node_modules/ripple-binary-codec/dist/binary.js"),u=r("../../node_modules/ripple-binary-codec/dist/types/hash-256.js"),c=r("../../node_modules/ripple-binary-codec/dist/types/st-object.js"),l=r("../../node_modules/ripple-binary-codec/dist/types/uint-64.js"),d=r("../../node_modules/ripple-binary-codec/dist/types/uint-32.js"),h=r("../../node_modules/ripple-binary-codec/dist/types/uint-8.js"),f=r("../../node_modules/ripple-binary-codec/dist/serdes/binary-parser.js"),p=r("../../node_modules/big-integer/BigInteger.js");function m(e,t){var r=new i.ShaMap;return t.forEach((function(t){return r.addItem.apply(r,e(t))})),r.hash()}function g(e){return n.ok(e.hash),[u.Hash256.from(e.hash),{hashPrefix:function(){return o.HashPrefix.transaction},toBytesSink:function(t){var r=new a.BinarySerializer(t);r.writeLengthEncoded(c.STObject.from(e)),r.writeLengthEncoded(c.STObject.from(e.metaData))}},void 0]}function y(e){var t=u.Hash256.from(e.index),r=(0,a.serializeObject)(e);return[t,{hashPrefix:function(){return o.HashPrefix.accountStateEntry},toBytesSink:function(e){e.put(r)}},void 0]}t.transactionTreeHash=function(e){return m(g,e)},t.accountStateHash=function(e){return m(y,e)},t.ledgerHash=function(e){var t=new s.Sha512Half;return t.put(o.HashPrefix.ledgerHeader),n.ok(void 0!==e.parent_close_time),n.ok(void 0!==e.close_flags),d.UInt32.from(e.ledger_index).toBytesSink(t),l.UInt64.from(p(String(e.total_coins))).toBytesSink(t),u.Hash256.from(e.parent_hash).toBytesSink(t),u.Hash256.from(e.transaction_hash).toBytesSink(t),u.Hash256.from(e.account_hash).toBytesSink(t),d.UInt32.from(e.parent_close_time).toBytesSink(t),d.UInt32.from(e.close_time).toBytesSink(t),h.UInt8.from(e.close_time_resolution).toBytesSink(t),h.UInt8.from(e.close_flags).toBytesSink(t),t.finish()},t.decodeLedgerData=function(e){n.ok("string"==typeof e,"binary must be a hex string");var t=new f.BinaryParser(e);return{ledger_index:t.readUInt32(),total_coins:t.readType(l.UInt64).valueOf().toString(),parent_hash:t.readType(u.Hash256).toHex(),transaction_hash:t.readType(u.Hash256).toHex(),account_hash:t.readType(u.Hash256).toHex(),parent_close_time:t.readUInt32(),close_time:t.readUInt32(),close_time_resolution:t.readUInt8(),close_flags:t.readUInt8()}}},"../../node_modules/ripple-binary-codec/dist/quality.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.quality=void 0;var n=r("../../node_modules/ripple-binary-codec/dist/types/index.js"),i=r("../../node_modules/decimal.js/decimal.js"),o=r("../../node_modules/big-integer/BigInteger.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=function(){function e(){}return e.encode=function(e){var t=new i.Decimal(e),r=t.e-15,s=t.times("1e".concat(-r)).abs().toString(),a=n.coreTypes.UInt64.from(o(s)).toBytes();return a[0]=r+100,a},e.decode=function(e){var t=s.Buffer.from(e,"hex").slice(-8),r=t[0]-100;return new i.Decimal("0x".concat(t.slice(1).toString("hex"))).times("1e".concat(r))},e}();t.quality=a},"../../node_modules/ripple-binary-codec/dist/serdes/binary-parser.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BinaryParser=void 0;var n=r("../../node_modules/assert/build/assert.js"),i=r("../../node_modules/ripple-binary-codec/dist/enums/index.js"),o=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),s=function(){function e(e){this.bytes=o.Buffer.from(e,"hex")}return e.prototype.peek=function(){return n.ok(0!==this.bytes.byteLength),this.bytes[0]},e.prototype.skip=function(e){n.ok(e<=this.bytes.byteLength),this.bytes=this.bytes.slice(e)},e.prototype.read=function(e){n.ok(e<=this.bytes.byteLength);var t=this.bytes.slice(0,e);return this.skip(e),t},e.prototype.readUIntN=function(e){return n.ok(0>>0},e.prototype.readUInt8=function(){return this.readUIntN(1)},e.prototype.readUInt16=function(){return this.readUIntN(2)},e.prototype.readUInt32=function(){return this.readUIntN(4)},e.prototype.size=function(){return this.bytes.byteLength},e.prototype.end=function(e){var t=this.bytes.byteLength;return 0===t||void 0!==e&&t<=e},e.prototype.readVariableLength=function(){return this.read(this.readVariableLengthLength())},e.prototype.readVariableLengthLength=function(){var e=this.readUInt8();if(e<=192)return e;if(e<=240)return 193+256*(e-193)+this.readUInt8();if(e<=254)return 12481+65536*(e-241)+256*this.readUInt8()+this.readUInt8();throw new Error("Invalid variable length indicator")},e.prototype.readFieldOrdinal=function(){var e=this.readUInt8(),t=15&e;if(0===(e>>=4)&&(0===(e=this.readUInt8())||e<16))throw new Error("Cannot read FieldOrdinal, type_code out of range");if(0===t&&(0===(t=this.readUInt8())||t<16))throw new Error("Cannot read FieldOrdinal, field_code out of range");return e<<16|t},e.prototype.readField=function(){return i.Field.fromString(this.readFieldOrdinal().toString())},e.prototype.readType=function(e){return e.fromParser(this)},e.prototype.typeForField=function(e){return e.associatedType},e.prototype.readFieldValue=function(e){var t=this.typeForField(e);if(!t)throw new Error("unsupported: (".concat(e.name,", ").concat(e.type.name,")"));var r=e.isVariableLengthEncoded?this.readVariableLengthLength():void 0,n=t.fromParser(this,r);if(void 0===n)throw new Error("fromParser for (".concat(e.name,", ").concat(e.type.name,") -> undefined "));return n},e.prototype.readFieldAndValue=function(){var e=this.readField();return[e,this.readFieldValue(e)]},e}();t.BinaryParser=s},"../../node_modules/ripple-binary-codec/dist/serdes/binary-serializer.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BinarySerializer=t.BytesList=void 0;var n=r("../../node_modules/assert/build/assert.js"),i=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),o=function(){function e(){this.bytesArray=[]}return e.prototype.getLength=function(){return i.Buffer.concat(this.bytesArray).byteLength},e.prototype.put=function(e){var t=i.Buffer.from(e);return this.bytesArray.push(t),this},e.prototype.toBytesSink=function(e){e.put(this.toBytes())},e.prototype.toBytes=function(){return i.Buffer.concat(this.bytesArray)},e.prototype.toHex=function(){return this.toBytes().toString("hex").toUpperCase()},e}();t.BytesList=o;var s=function(){function e(e){this.sink=new o,this.sink=e}return e.prototype.write=function(e){e.toBytesSink(this.sink)},e.prototype.put=function(e){this.sink.put(e)},e.prototype.writeType=function(e,t){this.write(e.from(t))},e.prototype.writeBytesList=function(e){e.toBytesSink(this.sink)},e.prototype.encodeVariableLength=function(e){var t=i.Buffer.alloc(3);if(e<=192)return t[0]=e,t.slice(0,1);if(e<=12480)return e-=193,t[0]=193+(e>>>8),t[1]=255&e,t.slice(0,2);if(e<=918744)return e-=12481,t[0]=241+(e>>>16),t[1]=e>>8&255,t[2]=255&e,t.slice(0,3);throw new Error("Overflow error")},e.prototype.writeFieldAndValue=function(e,t,r){void 0===r&&(r=!1);var i=e.associatedType.from(t);n.ok(void 0!==i.toBytesSink),n.ok(void 0!==e.name),this.sink.put(e.header),e.isVariableLengthEncoded?this.writeLengthEncoded(i,r):i.toBytesSink(this.sink)},e.prototype.writeLengthEncoded=function(e,t){void 0===t&&(t=!1);var r=new o;t||e.toBytesSink(r),this.put(this.encodeVariableLength(r.getLength())),this.writeBytesList(r)},e}();t.BinarySerializer=s},"../../node_modules/ripple-binary-codec/dist/shamap.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ShaMapLeaf=t.ShaMapNode=t.ShaMap=void 0;var o=r("../../node_modules/assert/build/assert.js"),s=r("../../node_modules/ripple-binary-codec/dist/types/index.js"),a=r("../../node_modules/ripple-binary-codec/dist/hash-prefixes.js"),u=r("../../node_modules/ripple-binary-codec/dist/hashes.js"),c=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),l=function(){};t.ShaMapNode=l;var d=function(e){function t(t,r){var n=e.call(this)||this;return n.index=t,n.item=r,n}return i(t,e),t.prototype.isLeaf=function(){return!0},t.prototype.isInner=function(){return!1},t.prototype.hashPrefix=function(){return void 0===this.item?c.Buffer.alloc(0):this.item.hashPrefix()},t.prototype.hash=function(){var e=u.Sha512Half.put(this.hashPrefix());return this.toBytesSink(e),e.finish()},t.prototype.toBytesSink=function(e){void 0!==this.item&&this.item.toBytesSink(e),this.index.toBytesSink(e)},t}(l);t.ShaMapLeaf=d;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(function(e){function t(t){void 0===t&&(t=0);var r=e.call(this)||this;return r.depth=t,r.slotBits=0,r.branches=Array(16),r}return i(t,e),t.prototype.isInner=function(){return!0},t.prototype.isLeaf=function(){return!1},t.prototype.hashPrefix=function(){return a.HashPrefix.innerNode},t.prototype.setBranch=function(e,t){this.slotBits=this.slotBits|1<>>2,i[1]|=(3&m)<<6}var g=u.Currency.from(e.currency).toBytes(),y=a.AccountID.from(e.issuer).toBytes();return new t(d.Buffer.concat([i,g,y]))}throw new Error("Invalid type to construct an Amount")},t.fromParser=function(e){var r=128&e.peek()?48:8;return new t(e.read(r))},t.prototype.toJSON=function(){if(this.isNative()){var e=this.bytes,r=64&e[0]?"":"-";e[0]&=63;var n=l(e.slice(0,4).readUInt32BE(0)),i=l(e.slice(4).readUInt32BE(0)),c=n.shiftLeft(32).or(i);return"".concat(r).concat(c.toString())}var d=new s.BinaryParser(this.toString()),h=d.read(8),f=u.Currency.fromParser(d),p=a.AccountID.fromParser(d),m=h[0],g=(r=64&m?"":"-",((63&m)<<2)+((255&h[1])>>6)-97);h[0]=0,h[1]&=63;var y=new o.Decimal("".concat(r,"0x").concat(h.toString("hex"))).times("1e".concat(g));return t.assertIouIsValid(y),{value:y.toString(),currency:f.toJSON(),issuer:p.toJSON()}},t.assertXrpIsValid=function(e){if(-1!==e.indexOf("."))throw new Error("".concat(e.toString()," is an illegal amount"));var t=new o.Decimal(e);if(!t.isZero()&&(t.lt(f)||t.gt(h)))throw new Error("".concat(e.toString()," is an illegal amount"))},t.assertIouIsValid=function(e){if(!e.isZero()){var t=e.precision(),r=e.e-15;if(t>16||r>80||r<-96)throw new Error("Decimal precision out of range");this.verifyNoDecimal(e)}},t.verifyNoDecimal=function(e){if(-1!==e.times("1e".concat(-(e.e-15))).abs().toString().indexOf("."))throw new Error("Decimal place found in integerNumberString")},t.prototype.isNative=function(){return 0==(128&this.bytes[0])},t.defaultAmount=new t(d.Buffer.from("4000000000000000","hex")),t}(c.SerializedType);t.Amount=m},"../../node_modules/ripple-binary-codec/dist/types/blob.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Blob=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/serialized-type.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.fromParser=function(e,r){return new t(e.read(r))},t.from=function(e){if(e instanceof t)return e;if("string"==typeof e)return new t(s.Buffer.from(e,"hex"));throw new Error("Cannot construct Blob from value given")},t}(o.SerializedType);t.Blob=a},"../../node_modules/ripple-binary-codec/dist/types/currency.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Currency=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/hash-160.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=/^0{40}$/,u=/^[A-Z0-9a-z?!@#$%^&*(){}[\]|]{3}$/,c=/^[A-F0-9]{40}$/,l=/^0{24}[\x00-\x7F]{6}0{10}$/;function d(e){var t=e.toString();return"XRP"===t?null:function(e){return u.test(e)}(t)?t:null}function h(e){return 3===e.length||(t=e,c.test(t));var t}function f(e){if(!function(e){return e instanceof s.Buffer?20===e.byteLength:h(e)}(e))throw new Error("Unsupported Currency representation: ".concat(e));return 3===e.length?function(e){var t=s.Buffer.alloc(20);if("XRP"!==e){var r=e.split("").map((function(e){return e.charCodeAt(0)}));t.set(r,12)}return t}(e):s.Buffer.from(e,"hex")}var p=function(e){function t(r){var n=e.call(this,null!=r?r:t.XRP.bytes)||this,i=n.bytes.toString("hex");return a.test(i)?n._iso="XRP":l.test(i)?n._iso=d(n.bytes.slice(12,15)):n._iso=null,n}return i(t,e),t.prototype.iso=function(){return this._iso},t.from=function(e){if(e instanceof t)return e;if("string"==typeof e)return new t(f(e));throw new Error("Cannot construct Currency from value given")},t.prototype.toJSON=function(){var e=this.iso();return null!==e?e:this.bytes.toString("hex").toUpperCase()},t.XRP=new t(s.Buffer.alloc(20)),t}(o.Hash160);t.Currency=p},"../../node_modules/ripple-binary-codec/dist/types/hash-128.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Hash128=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/hash.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=function(e){function t(r){return e.call(this,null!=r?r:t.ZERO_128.bytes)||this}return i(t,e),t.width=16,t.ZERO_128=new t(s.Buffer.alloc(t.width)),t}(o.Hash);t.Hash128=a},"../../node_modules/ripple-binary-codec/dist/types/hash-160.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Hash160=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/hash.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=function(e){function t(r){return r&&0===r.byteLength&&(r=t.ZERO_160.bytes),e.call(this,null!=r?r:t.ZERO_160.bytes)||this}return i(t,e),t.width=20,t.ZERO_160=new t(s.Buffer.alloc(t.width)),t}(o.Hash);t.Hash160=a},"../../node_modules/ripple-binary-codec/dist/types/hash-256.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Hash256=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/hash.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=function(e){function t(r){return e.call(this,null!=r?r:t.ZERO_256.bytes)||this}return i(t,e),t.width=32,t.ZERO_256=new t(s.Buffer.alloc(t.width)),t}(o.Hash);t.Hash256=a},"../../node_modules/ripple-binary-codec/dist/types/hash.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/serialized-type.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=function(e){function t(t){var r=e.call(this,t)||this;if(r.bytes.byteLength!==r.constructor.width)throw new Error("Invalid Hash length ".concat(r.bytes.byteLength));return r}return i(t,e),t.from=function(e){if(e instanceof this)return e;if("string"==typeof e)return new this(s.Buffer.from(e,"hex"));throw new Error("Cannot construct Hash from given value")},t.fromParser=function(e,t){return new this(e.read(null!=t?t:this.width))},t.prototype.compareTo=function(e){return this.bytes.compare(this.constructor.from(e).bytes)},t.prototype.toString=function(){return this.toHex()},t.prototype.nibblet=function(e){var t=e>0?e/2|0:0,r=this.bytes[t];return e%2==0?r=(240&r)>>>4:r&=15,r},t}(o.Comparable);t.Hash=a},"../../node_modules/ripple-binary-codec/dist/types/index.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coreTypes=void 0;var n=r("../../node_modules/ripple-binary-codec/dist/enums/index.js"),i=r("../../node_modules/ripple-binary-codec/dist/types/account-id.js"),o=r("../../node_modules/ripple-binary-codec/dist/types/amount.js"),s=r("../../node_modules/ripple-binary-codec/dist/types/blob.js"),a=r("../../node_modules/ripple-binary-codec/dist/types/currency.js"),u=r("../../node_modules/ripple-binary-codec/dist/types/hash-128.js"),c=r("../../node_modules/ripple-binary-codec/dist/types/hash-160.js"),l=r("../../node_modules/ripple-binary-codec/dist/types/hash-256.js"),d=r("../../node_modules/ripple-binary-codec/dist/types/path-set.js"),h=r("../../node_modules/ripple-binary-codec/dist/types/st-array.js"),f=r("../../node_modules/ripple-binary-codec/dist/types/st-object.js"),p=r("../../node_modules/ripple-binary-codec/dist/types/uint-16.js"),m=r("../../node_modules/ripple-binary-codec/dist/types/uint-32.js"),g=r("../../node_modules/ripple-binary-codec/dist/types/uint-64.js"),y=r("../../node_modules/ripple-binary-codec/dist/types/uint-8.js"),b=r("../../node_modules/ripple-binary-codec/dist/types/vector-256.js"),v={AccountID:i.AccountID,Amount:o.Amount,Blob:s.Blob,Currency:a.Currency,Hash128:u.Hash128,Hash160:c.Hash160,Hash256:l.Hash256,PathSet:d.PathSet,STArray:h.STArray,STObject:f.STObject,UInt8:y.UInt8,UInt16:p.UInt16,UInt32:m.UInt32,UInt64:g.UInt64,Vector256:b.Vector256};t.coreTypes=v,Object.values(n.Field).forEach((function(e){e.associatedType=v[e.type.name]})),n.Field.TransactionType.associatedType=n.TransactionType,n.Field.TransactionResult.associatedType=n.TransactionResult,n.Field.LedgerEntryType.associatedType=n.LedgerEntryType},"../../node_modules/ripple-binary-codec/dist/types/path-set.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.PathSet=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/account-id.js"),s=r("../../node_modules/ripple-binary-codec/dist/types/currency.js"),a=r("../../node_modules/ripple-binary-codec/dist/serdes/binary-parser.js"),u=r("../../node_modules/ripple-binary-codec/dist/types/serialized-type.js"),c=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js");var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.from=function(e){if(e instanceof t)return e;var r=[c.Buffer.from([0])];return e.account&&(r.push(o.AccountID.from(e.account).toBytes()),r[0][0]|=1),e.currency&&(r.push(s.Currency.from(e.currency).toBytes()),r[0][0]|=16),e.issuer&&(r.push(o.AccountID.from(e.issuer).toBytes()),r[0][0]|=32),new t(c.Buffer.concat(r))},t.fromParser=function(e){var r=e.readUInt8(),n=[c.Buffer.from([r])];return 1&r&&n.push(e.read(o.AccountID.width)),16&r&&n.push(e.read(s.Currency.width)),32&r&&n.push(e.read(o.AccountID.width)),new t(c.Buffer.concat(n))},t.prototype.toJSON=function(){var e,t,r,n=new a.BinaryParser(this.bytes.toString("hex")),i=n.readUInt8();1&i&&(e=o.AccountID.fromParser(n).toJSON()),16&i&&(t=s.Currency.fromParser(n).toJSON()),32&i&&(r=o.AccountID.fromParser(n).toJSON());var u={};return e&&(u.account=e),r&&(u.issuer=r),t&&(u.currency=t),u},t.prototype.type=function(){return this.bytes[0]},t}(u.SerializedType),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.from=function(e){if(e instanceof t)return e;var r=[];return e.forEach((function(e){r.push(l.from(e).toBytes())})),new t(c.Buffer.concat(r))},t.fromParser=function(e){for(var r=[];!e.end()&&(r.push(l.fromParser(e).toBytes()),0!==e.peek()&&255!==e.peek()););return new t(c.Buffer.concat(r))},t.prototype.toJSON=function(){for(var e=[],t=new a.BinaryParser(this.toString());!t.end();)e.push(l.fromParser(t).toJSON());return e},t}(u.SerializedType),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.from=function(e){if(e instanceof t)return e;if(n=e,Array.isArray(n)&&0===n.length||Array.isArray(n)&&Array.isArray(n[0])&&0===n[0].length||Array.isArray(n)&&Array.isArray(n[0])&&function(e){return void 0!==e.issuer||void 0!==e.account||void 0!==e.currency}(n[0][0])){var r=[];return e.forEach((function(e){r.push(d.from(e).toBytes()),r.push(c.Buffer.from([255]))})),r[r.length-1]=c.Buffer.from([0]),new t(c.Buffer.concat(r))}var n;throw new Error("Cannot construct PathSet from given value")},t.fromParser=function(e){for(var r=[];!e.end()&&(r.push(d.fromParser(e).toBytes()),r.push(e.read(1)),0!=r[r.length-1][0]););return new t(c.Buffer.concat(r))},t.prototype.toJSON=function(){for(var e=[],t=new a.BinaryParser(this.toString());!t.end();)e.push(d.fromParser(t).toJSON()),t.skip(1);return e},t}(u.SerializedType);t.PathSet=h},"../../node_modules/ripple-binary-codec/dist/types/serialized-type.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Comparable=t.SerializedType=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/serdes/binary-serializer.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=function(){function e(e){this.bytes=s.Buffer.alloc(0),this.bytes=null!=e?e:s.Buffer.alloc(0)}return e.fromParser=function(e,t){throw new Error("fromParser not implemented")},e.from=function(e){throw new Error("from not implemented")},e.prototype.toBytesSink=function(e){e.put(this.bytes)},e.prototype.toHex=function(){return this.toBytes().toString("hex").toUpperCase()},e.prototype.toBytes=function(){if(this.bytes)return this.bytes;var e=new o.BytesList;return this.toBytesSink(e),e.toBytes()},e.prototype.toJSON=function(){return this.toHex()},e.prototype.toString=function(){return this.toHex()},e}();t.SerializedType=a;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.lt=function(e){return this.compareTo(e)<0},t.prototype.eq=function(e){return 0===this.compareTo(e)},t.prototype.gt=function(e){return this.compareTo(e)>0},t.prototype.gte=function(e){return this.compareTo(e)>-1},t.prototype.lte=function(e){return this.compareTo(e)<1},t.prototype.compareTo=function(e){throw new Error("cannot compare ".concat(this.toString()," and ").concat(e.toString()))},t}(a);t.Comparable=u},"../../node_modules/ripple-binary-codec/dist/types/st-array.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.STArray=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/serialized-type.js"),s=r("../../node_modules/ripple-binary-codec/dist/types/st-object.js"),a=r("../../node_modules/ripple-binary-codec/dist/serdes/binary-parser.js"),u=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),c=u.Buffer.from([241]),l="ArrayEndMarker",d=u.Buffer.from([225]);var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.fromParser=function(e){for(var r=[];!e.end();){var n=e.readField();if(n.name===l)break;r.push(n.header,e.readFieldValue(n).toBytes(),d)}return r.push(c),new t(u.Buffer.concat(r))},t.from=function(e){if(e instanceof t)return e;if(n=e,Array.isArray(n)&&(0===n.length||"object"==typeof n[0])){var r=[];return e.forEach((function(e){r.push(s.STObject.from(e).toBytes())})),r.push(c),new t(u.Buffer.concat(r))}var n;throw new Error("Cannot construct STArray from value given")},t.prototype.toJSON=function(){for(var e=[],t=new a.BinaryParser(this.toString());!t.end();){var r=t.readField();if(r.name===l)break;var n={};n[r.name]=s.STObject.fromParser(t).toJSON(),e.push(n)}return e},t}(o.SerializedType);t.STArray=h},"../../node_modules/ripple-binary-codec/dist/types/st-object.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.STObject=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/enums/index.js"),s=r("../../node_modules/ripple-binary-codec/dist/types/serialized-type.js"),a=r("../../node_modules/ripple-address-codec/dist/index.js"),u=r("../../node_modules/ripple-binary-codec/dist/serdes/binary-parser.js"),c=r("../../node_modules/ripple-binary-codec/dist/serdes/binary-serializer.js"),l=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js").Buffer.from([225]),d="ObjectEndMarker",h="STObject",f="SourceTag",p="DestinationTag";var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.fromParser=function(e){for(var r=new c.BytesList,n=new c.BinarySerializer(r);!e.end();){var i=e.readField();if(i.name===d)break;var o=e.readFieldValue(i);n.writeFieldAndValue(i,o),i.type.name===h&&n.put(l)}return new t(r.toBytes())},t.from=function(e,r){if(e instanceof t)return e;var n=new c.BytesList,i=new c.BinarySerializer(n),s=!1,u=Object.entries(e).reduce((function(t,r){var n,i=r[0],o=r[1],s=void 0;return o&&(0,a.isValidXAddress)(o.toString())&&(s=function(e,t){var r,n,i,o=(0,a.xAddressToClassicAddress)(t);if("Destination"===e)i=p;else if("Account"===e)i=f;else if(!1!==o.tag)throw new Error("".concat(e," cannot have an associated tag"));return!1!==o.tag?((r={})[e]=o.classicAddress,r[i]=o.tag,r):((n={})[e]=o.classicAddress,n)}(i,o.toString()),function(e,t){if(void 0!==e[f]&&void 0!==t[f])throw new Error("Cannot have Account X-Address and SourceTag");if(void 0!==e[p]&&void 0!==t[p])throw new Error("Cannot have Destination X-Address and DestinationTag")}(s,e)),Object.assign(t,null!=s?s:((n={})[i]=o,n))}),{}),d=Object.keys(u).map((function(e){return o.Field[e]})).filter((function(e){return void 0!==e&&void 0!==u[e.name]&&e.isSerialized})).sort((function(e,t){return e.ordinal-t.ordinal}));return void 0!==r&&(d=d.filter(r)),d.forEach((function(e){var t=e.associatedType.from(u[e.name]);if(null==t)throw new TypeError('Unable to interpret "'.concat(e.name,": ").concat(u[e.name],'".'));"UNLModify"===t.name&&(s=!0);var r="Account"==e.name&&s;i.writeFieldAndValue(e,t,r),e.type.name===h&&i.put(l)})),new t(n.toBytes())},t.prototype.toJSON=function(){for(var e=new u.BinaryParser(this.toString()),t={};!e.end();){var r=e.readField();if(r.name===d)break;t[r.name]=e.readFieldValue(r).toJSON()}return t},t}(s.SerializedType);t.STObject=m},"../../node_modules/ripple-binary-codec/dist/types/uint-16.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.UInt16=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/uint.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=function(e){function t(r){return e.call(this,null!=r?r:t.defaultUInt16.bytes)||this}return i(t,e),t.fromParser=function(e){return new t(e.read(t.width))},t.from=function(e){if(e instanceof t)return e;if("number"==typeof e){var r=s.Buffer.alloc(t.width);return r.writeUInt16BE(e,0),new t(r)}throw new Error("Can not construct UInt16 with given value")},t.prototype.valueOf=function(){return this.bytes.readUInt16BE(0)},t.width=2,t.defaultUInt16=new t(s.Buffer.alloc(t.width)),t}(o.UInt);t.UInt16=a},"../../node_modules/ripple-binary-codec/dist/types/uint-32.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.UInt32=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/uint.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=function(e){function t(r){return e.call(this,null!=r?r:t.defaultUInt32.bytes)||this}return i(t,e),t.fromParser=function(e){return new t(e.read(t.width))},t.from=function(e){if(e instanceof t)return e;var r=s.Buffer.alloc(t.width);if("string"==typeof e){var n=Number.parseInt(e);return r.writeUInt32BE(n,0),new t(r)}if("number"==typeof e)return r.writeUInt32BE(e,0),new t(r);throw new Error("Cannot construct UInt32 from given value")},t.prototype.valueOf=function(){return this.bytes.readUInt32BE(0)},t.width=4,t.defaultUInt32=new t(s.Buffer.alloc(t.width)),t}(o.UInt);t.UInt32=a},"../../node_modules/ripple-binary-codec/dist/types/uint-64.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.UInt64=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/uint.js"),s=r("../../node_modules/big-integer/BigInteger.js"),a=r("../../node_modules/big-integer/BigInteger.js"),u=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),c=/^[a-fA-F0-9]{1,16}$/,l=s(4294967295),d=function(e){function t(r){return e.call(this,null!=r?r:t.defaultUInt64.bytes)||this}return i(t,e),t.fromParser=function(e){return new t(e.read(t.width))},t.from=function(e){if(e instanceof t)return e;u.Buffer.alloc(t.width);if("number"==typeof e){if(e<0)throw new Error("value must be an unsigned integer");var r,n=s(e);return(r=[u.Buffer.alloc(4),u.Buffer.alloc(4)])[0].writeUInt32BE(Number(n.shiftRight(32)),0),r[1].writeUInt32BE(Number(n.and(l)),0),new t(u.Buffer.concat(r))}if("string"==typeof e){if(!c.test(e))throw new Error("".concat(e," is not a valid hex-string"));var i=e.padStart(16,"0");return new t(u.Buffer.from(i,"hex"))}if((0,a.isInstance)(e))return(r=[u.Buffer.alloc(4),u.Buffer.alloc(4)])[0].writeUInt32BE(Number(e.shiftRight(s(32))),0),r[1].writeUInt32BE(Number(e.and(l)),0),new t(u.Buffer.concat(r));throw new Error("Cannot construct UInt64 from given value")},t.prototype.toJSON=function(){return this.bytes.toString("hex").toUpperCase()},t.prototype.valueOf=function(){var e=s(this.bytes.slice(0,4).readUInt32BE(0)),t=s(this.bytes.slice(4).readUInt32BE(0));return e.shiftLeft(s(32)).or(t)},t.prototype.toBytes=function(){return this.bytes},t.width=8,t.defaultUInt64=new t(u.Buffer.alloc(t.width)),t}(o.UInt);t.UInt64=d},"../../node_modules/ripple-binary-codec/dist/types/uint-8.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.UInt8=void 0;var o=r("../../node_modules/ripple-binary-codec/dist/types/uint.js"),s=r("../../node_modules/ripple-binary-codec/node_modules/buffer/index.js"),a=function(e){function t(r){return e.call(this,null!=r?r:t.defaultUInt8.bytes)||this}return i(t,e),t.fromParser=function(e){return new t(e.read(t.width))},t.from=function(e){if(e instanceof t)return e;if("number"==typeof e){var r=s.Buffer.alloc(t.width);return r.writeUInt8(e,0),new t(r)}throw new Error("Cannot construct UInt8 from given value")},t.prototype.valueOf=function(){return this.bytes.readUInt8(0)},t.width=1,t.defaultUInt8=new t(s.Buffer.alloc(t.width)),t}(o.UInt);t.UInt8=a},"../../node_modules/ripple-binary-codec/dist/types/uint.js":function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.UInt=void 0;var o=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.compareTo=function(e){return t=this.valueOf(),r=e.valueOf(),t{"use strict"; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */var n=r("../../node_modules/base64-js/index.js"),i=r("../../node_modules/ieee754/index.js"),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=Buffer,t.SlowBuffer=function(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;var s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|p(e,t),n=a(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var i=function(e){if(Buffer.isBuffer(e)){var t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||z(e.length)?a(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return c(e),a(e<0?0:0|f(e))}function d(e){for(var t=e.length<0?0:0|f(e.length),r=a(t),n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function p(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(e).length;default:if(i)return n?-1:F(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var d=!0,h=0;hi&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function E(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+d<=r)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=d}return function(e){var t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nr&&(e+=" ... "),""},o&&(Buffer.prototype[o]=Buffer.prototype.inspect),Buffer.prototype.compare=function(e,t,r,n,i){if(U(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return M(this,e,t,r);case"base64":return j(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function O(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||I(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return e>>>=0,t||I(e,4,this.length),i.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),i.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),i.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),i.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||R(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n)||R(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function(e,t,r){return C(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return C(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},Buffer.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function D(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function U(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}var V=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},"../../node_modules/ripple-keypairs/dist/Sha512.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r("../../node_modules/hash.js/lib/hash.js"),i=r("../../node_modules/bn.js/lib/bn.js");t.default=class{constructor(){this.hash=n.sha512()}add(e){return this.hash.update(e),this}addU32(e){return this.add([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}finish(){return this.hash.digest()}first256(){return this.finish().slice(0,32)}first256BN(){return new i(this.first256())}}},"../../node_modules/ripple-keypairs/dist/index.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;const n=r("../../node_modules/assert/build/assert.js"),i=r("../../node_modules/brorand/index.js"),o=r("../../node_modules/hash.js/lib/hash.js"),s=r("../../node_modules/elliptic/lib/elliptic.js"),a=r("../../node_modules/ripple-address-codec/dist/index.js"),u=r("../../node_modules/ripple-keypairs/dist/secp256k1.js"),c=r("../../node_modules/ripple-keypairs/dist/utils.js"),l=s.eddsa("ed25519"),d=s.ec("secp256k1"),{hexToBytes:h}=c,{bytesToHex:f}=c;function p(e){return o.sha512().update(e).digest().slice(0,32)}const m={deriveKeypair(e,t){const r="00"+(0,u.derivePrivateKey)(e,t).toString(16,64).toUpperCase(),n=f(d.keyFromPrivate(r.slice(2)).getPublic().encodeCompressed());return{privateKey:r,publicKey:n}},sign:(e,t)=>f(d.sign(p(e),h(t),{canonical:!0}).toDER()),verify:(e,t,r)=>d.verify(p(e),t,h(r))},g={deriveKeypair(e){const t=p(e);return{privateKey:"ED"+f(t),publicKey:"ED"+f(l.keyFromSecret(t).pubBytes())}},sign:(e,t)=>(n.ok(Array.isArray(e),"message must be array of octets"),f(l.sign(e,h(t).slice(1)).toBytes())),verify:(e,t,r)=>l.verify(e,h(t),h(r).slice(1))};function y(e){return{"ecdsa-secp256k1":m,ed25519:g}[e]}function b(e){const t=h(e);return 33===t.length&&237===t[0]?"ed25519":"ecdsa-secp256k1"}function v(e){return a.encodeAccountID(c.computePublicKeyHash(e))}const{decodeSeed:_}=a;e.exports={generateSeed:function(e={}){n.ok(!e.entropy||e.entropy.length>=16,"entropy too short");const t=e.entropy?e.entropy.slice(0,16):i(16),r="ed25519"===e.algorithm?"ed25519":"secp256k1";return a.encodeSeed(Buffer.from(t),r)},deriveKeypair:function(e,t){const r=a.decodeSeed(e),n=y("ed25519"===r.type?"ed25519":"ecdsa-secp256k1"),i=n.deriveKeypair(r.bytes,t),o=p("This test message should verify."),s=n.sign(o,i.privateKey);if(!0!==n.verify(o,s,i.publicKey))throw new Error("derived keypair did not generate verifiable signature");return i},sign:function(e,t){return y(b(t)).sign(h(e),t)},verify:function(e,t,r){return y(b(r)).verify(h(e),t,r)},deriveAddress:function(e){return v(Buffer.from(h(e)))},deriveNodeAddress:function(e){const t=a.decodeNodePublic(e);return v((0,u.accountPublicFromPublicGenerator)(t))},decodeSeed:_}},"../../node_modules/ripple-keypairs/dist/secp256k1.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accountPublicFromPublicGenerator=t.derivePrivateKey=void 0;const n=r("../../node_modules/elliptic/lib/elliptic.js"),i=r("../../node_modules/ripple-keypairs/dist/Sha512.js"),o=n.ec("secp256k1");function s(e,t){const r=o.curve.n;for(let n=0;n<=4294967295;n++){const o=(new i.default).add(e);void 0!==t&&o.addU32(t),o.addU32(n);const s=o.first256BN();if(s.cmpn(0)>0&&s.cmp(r)<0)return s}throw new Error("impossible unicorn ;)")}t.derivePrivateKey=function(e,t={}){const r=t.validator,n=o.curve.n,i=s(e);if(r)return i;const a=o.g.mul(i),u=t.accountIndex||0;return s(a.encodeCompressed(),u).add(i).mod(n)},t.accountPublicFromPublicGenerator=function(e){const t=o.curve.decodePoint(e),r=s(e,0),n=o.g.mul(r);return t.add(n).encodeCompressed()}},"../../node_modules/ripple-keypairs/dist/utils.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.computePublicKeyHash=t.hexToBytes=t.bytesToHex=void 0;const n=r("../../node_modules/assert/build/assert.js"),i=r("../../node_modules/hash.js/lib/hash.js"),o=r("../../node_modules/bn.js/lib/bn.js");t.bytesToHex=function(e){return Array.from(e,(e=>{const t=e.toString(16).toUpperCase();return t.length>1?t:`0${t}`})).join("")},t.hexToBytes=function(e){return n.ok(e.length%2==0),0===e.length?[]:new o(e,16).toArray(null,e.length/2)},t.computePublicKeyHash=function(e){const t=i.sha256().update(e).digest(),r=i.ripemd160().update(t).digest();return Buffer.from(r)}},"../../node_modules/ripple-lib-transactionparser/src/balancechanges.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/lodash/lodash.js"),i=r("../../node_modules/bignumber.js/bignumber.js"),o=r("../../node_modules/ripple-lib-transactionparser/src/utils.js").normalizeNodes,s=r("../../node_modules/ripple-lib-transactionparser/src/utils.js").dropsToXRP;function a(e){return new i(e.value||e)}function u(e){var t=null;return e.newFields.Balance?t=a(e.newFields.Balance):e.previousFields.Balance&&e.finalFields.Balance&&(t=a(e.finalFields.Balance).minus(a(e.previousFields.Balance))),null===t||t.isZero()?null:t}function c(e){return e.newFields.Balance?a(e.newFields.Balance):e.finalFields.Balance?a(e.finalFields.Balance):null}function l(e,t){var r=t(e);return null===r?null:{address:e.finalFields.Account||e.newFields.Account,balance:{counterparty:"",currency:"XRP",value:s(r).toString()}}}function d(e,t){var r,s,a=o(e).map((function(e){return"AccountRoot"===e.entryType?[l(e,t)]:"RippleState"===e.entryType?function(e,t){var r=t(e);if(null===r)return null;var o,s,a=n.isEmpty(e.newFields)?e.finalFields:e.newFields,u={address:a.LowLimit.issuer,balance:{counterparty:a.HighLimit.issuer,currency:a.Balance.currency,value:r.toString()}};return[u,(o=u,s=new i(o.balance.value).negated(),{address:o.balance.counterparty,balance:{counterparty:o.address,currency:o.balance.currency,value:s.toString()}})]}(e,t):[]}));return r=n.compact(n.flatten(a)),s=n.groupBy(r,(function(e){return e.address})),n.mapValues(s,(function(e){return n.map(e,(function(e){return e.balance}))}))}e.exports.parseBalanceChanges=function(e){return d(e,u)},e.exports.parseFinalBalances=function(e){return d(e,c)}},"../../node_modules/ripple-lib-transactionparser/src/channelchanges.js":(e,t,r)=>{"use strict";const n=r("../../node_modules/ripple-lib-transactionparser/src/utils.js").normalizeNodes,i=r("../../node_modules/bignumber.js/bignumber.js");function o(e){return"CreatedNode"===e.diffType?"created":"ModifiedNode"===e.diffType?"modified":"DeletedNode"===e.diffType?"deleted":void 0}e.exports.parseChannelChanges=function(e){const t=n(e).filter((e=>"PayChannel"===e.entryType));return 1===t.length?function(e){const t="CreatedNode"===e.diffType?e.newFields:e.finalFields,r=e.previousFields||{},n={status:o(e),channelId:e.ledgerIndex,source:t.Account,destination:t.Destination,channelAmountDrops:new i(t.Amount||0).toString(10),channelBalanceDrops:new i(t.Balance||0).toString(10)};return r.Amount&&(n.channelAmountChangeDrops=new i(t.Amount).minus(new i(r.Amount||0)).toString(10)),r.Balance&&(n.channelBalanceChangeDrops=new i(t.Balance).minus(new i(r.Balance||0)).toString(10)),e.PreviousTxnID&&(n.previousTxnId=e.PreviousTxnID),n}(t[0]):void 0}},"../../node_modules/ripple-lib-transactionparser/src/index.js":(e,t,r)=>{"use strict";e.exports.parseBalanceChanges=r("../../node_modules/ripple-lib-transactionparser/src/balancechanges.js").parseBalanceChanges,e.exports.parseFinalBalances=r("../../node_modules/ripple-lib-transactionparser/src/balancechanges.js").parseFinalBalances,e.exports.parseOrderbookChanges=r("../../node_modules/ripple-lib-transactionparser/src/orderbookchanges.js").parseOrderbookChanges,e.exports.getAffectedAccounts=r("../../node_modules/ripple-lib-transactionparser/src/utils.js").getAffectedAccounts,e.exports.parseChannelChanges=r("../../node_modules/ripple-lib-transactionparser/src/channelchanges.js").parseChannelChanges},"../../node_modules/ripple-lib-transactionparser/src/orderbookchanges.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/lodash/lodash.js"),i=r("../../node_modules/ripple-lib-transactionparser/src/utils.js"),o=r("../../node_modules/bignumber.js/bignumber.js").clone({DECIMAL_PLACES:40}),s=r("../../node_modules/ripple-lib-transactionparser/src/quality.js");function a(e){var t,r=e.taker_gets,i=e.taker_pays,o=e.sell?"sell":"buy";return t={direction:o,quantity:"buy"===o?i:r,totalPrice:"buy"===o?r:i,sequence:e.sequence,status:e.status,makerExchangeRate:e.quality,expirationTime:e.expiration},n.omitBy(t,n.isUndefined)}function u(e){var t,r=e.finalFields.Expiration||e.newFields.Expiration;if(void 0!==r)return new Date((t=r,1e3*(t+946684800))).toISOString()}function c(e){var t=e.finalFields.TakerGets||e.newFields.TakerGets,r=e.finalFields.TakerPays||e.newFields.TakerPays,n=t.currency||"XRP",i=r.currency||"XRP",o=e.finalFields.BookDirectory||e.newFields.BookDirectory,a=o.substring(o.length-16);return s(a,n,i)}function l(e){return"CreatedNode"===e.diffType?"created":"ModifiedNode"===e.diffType?"partially-filled":"DeletedNode"===e.diffType?e.previousFields.hasOwnProperty("TakerPays")?"filled":"cancelled":void 0}function d(e,t){var r=l(e);if("cancelled"===r)return i.parseCurrencyAmount(e.finalFields[t]);if("created"===r)return i.parseCurrencyAmount(e.newFields[t]);var s=i.parseCurrencyAmount(e.finalFields[t]),a=function(e,t){if(t){var r=new o(e.value),n=new o(t.value);return r.minus(n).abs().toString()}return"0"}(s,i.parseCurrencyAmount(e.previousFields[t]));return n.assign({},s,{value:a})}function h(e){var t=a({taker_pays:d(e,"TakerPays"),taker_gets:d(e,"TakerGets"),sell:0!=(131072&e.finalFields.Flags),sequence:e.finalFields.Sequence||e.newFields.Sequence,status:l(e),quality:c(e),expiration:u(e)});return Object.defineProperty(t,"account",{value:e.finalFields.Account||e.newFields.Account}),t}t.parseOrderbookChanges=function(e){var t=i.normalizeNodes(e);return function(e){return n.groupBy(e,(function(e){return e.account}))}(n.map(n.filter(t,(function(e){return"Offer"===e.entryType})),h))}},"../../node_modules/ripple-lib-transactionparser/src/quality.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/assert/build/assert.js"),i=r("../../node_modules/bignumber.js/bignumber.js");e.exports=function(e,t,r){n(16===e.length);var o=new i(e.substring(2),16),s=parseInt(e.substring(0,2),16)-100;return function(e,t,r){var n=("XRP"===r?-6:0)-("XRP"===t?-6:0);return 0===n?new i(e).toString():new i(e).shiftedBy(n).toString()}(o.toString()+"e"+s.toString(),t,r)}},"../../node_modules/ripple-lib-transactionparser/src/utils.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/lodash/lodash.js"),i=r("../../node_modules/bignumber.js/bignumber.js");function o(e){return e.dividedBy(1e6)}function s(e){var t=Object.keys(e)[0],r=e[t];return Object.assign({},r,{diffType:t,entryType:r.LedgerEntryType,ledgerIndex:r.LedgerIndex,newFields:r.NewFields||{},finalFields:r.FinalFields||{},previousFields:r.PreviousFields||{}})}function a(e){return e.AffectedNodes?e.AffectedNodes.map(s):[]}e.exports={dropsToXRP:o,normalizeNodes:a,parseCurrencyAmount:function(e){if(void 0!==e)return"string"==typeof e?{currency:"XRP",value:o(new i(e)).toString()}:{currency:e.currency,counterparty:e.issuer,value:e.value}},getAffectedAccounts:function(e){var t=[];return n.forEach(a(e),(function(e){var r="CreatedNode"===e.diffType?e.newFields:e.finalFields;n.forEach(r,(function(e,r){!function(e){return n.includes(["Account","Owner","Destination","Issuer","Target"],e)}(r)?function(e){return n.includes(["LowLimit","HighLimit","TakerPays","TakerGets"],e)}(r)&&e.issuer&&t.push(e.issuer):t.push(e)}))})),n.uniq(t)}}},"../../node_modules/ripple-lib/dist/npm/api.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RippleAPI=void 0;const c=r("../../node_modules/events/events.js"),l=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),d=r("../../node_modules/ripple-lib/dist/npm/server/server.js"),h=u(r("../../node_modules/ripple-lib/dist/npm/ledger/transaction.js")),f=u(r("../../node_modules/ripple-lib/dist/npm/ledger/transactions.js")),p=u(r("../../node_modules/ripple-lib/dist/npm/ledger/trustlines.js")),m=u(r("../../node_modules/ripple-lib/dist/npm/ledger/balances.js")),g=u(r("../../node_modules/ripple-lib/dist/npm/ledger/balance-sheet.js")),y=u(r("../../node_modules/ripple-lib/dist/npm/ledger/pathfind.js")),b=u(r("../../node_modules/ripple-lib/dist/npm/ledger/orders.js")),v=r("../../node_modules/ripple-lib/dist/npm/ledger/orderbook.js"),_=r("../../node_modules/ripple-lib/dist/npm/ledger/settings.js"),w=u(r("../../node_modules/ripple-lib/dist/npm/ledger/accountinfo.js")),M=u(r("../../node_modules/ripple-lib/dist/npm/ledger/accountobjects.js")),j=u(r("../../node_modules/ripple-lib/dist/npm/ledger/payment-channel.js")),S=u(r("../../node_modules/ripple-lib/dist/npm/transaction/payment.js")),A=u(r("../../node_modules/ripple-lib/dist/npm/transaction/trustline.js")),E=u(r("../../node_modules/ripple-lib/dist/npm/transaction/order.js")),x=u(r("../../node_modules/ripple-lib/dist/npm/transaction/ordercancellation.js")),O=u(r("../../node_modules/ripple-lib/dist/npm/transaction/escrow-creation.js")),T=u(r("../../node_modules/ripple-lib/dist/npm/transaction/escrow-execution.js")),P=u(r("../../node_modules/ripple-lib/dist/npm/transaction/escrow-cancellation.js")),k=u(r("../../node_modules/ripple-lib/dist/npm/transaction/payment-channel-create.js")),I=u(r("../../node_modules/ripple-lib/dist/npm/transaction/payment-channel-fund.js")),R=u(r("../../node_modules/ripple-lib/dist/npm/transaction/payment-channel-claim.js")),N=u(r("../../node_modules/ripple-lib/dist/npm/transaction/check-create.js")),C=u(r("../../node_modules/ripple-lib/dist/npm/transaction/check-cancel.js")),B=u(r("../../node_modules/ripple-lib/dist/npm/transaction/check-cash.js")),L=u(r("../../node_modules/ripple-lib/dist/npm/transaction/settings.js")),F=u(r("../../node_modules/ripple-lib/dist/npm/transaction/ticket.js")),D=u(r("../../node_modules/ripple-lib/dist/npm/transaction/sign.js")),q=u(r("../../node_modules/ripple-lib/dist/npm/transaction/combine.js")),U=u(r("../../node_modules/ripple-lib/dist/npm/transaction/submit.js")),z=r("../../node_modules/ripple-lib/dist/npm/offline/utils.js"),V=r("../../node_modules/ripple-lib/dist/npm/offline/derive.js"),$=u(r("../../node_modules/ripple-lib/dist/npm/offline/ledgerhash.js")),H=u(r("../../node_modules/ripple-lib/dist/npm/offline/sign-payment-channel-claim.js")),K=u(r("../../node_modules/ripple-lib/dist/npm/offline/verify-payment-channel-claim.js")),X=u(r("../../node_modules/ripple-lib/dist/npm/ledger/ledger.js")),Z=u(r("../../node_modules/ripple-lib/dist/npm/common/rangeset.js")),J=s(r("../../node_modules/ripple-lib/dist/npm/ledger/utils.js")),G=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),W=s(r("../../node_modules/ripple-lib/dist/npm/common/schema-validator.js")),Y=r("../../node_modules/ripple-lib/dist/npm/common/serverinfo.js"),Q=r("../../node_modules/ripple-lib/dist/npm/ledger/utils.js"),ee=r("../../node_modules/ripple-address-codec/dist/index.js"),te=r("../../node_modules/ripple-lib/dist/npm/common/hashes/index.js"),re=u(r("../../node_modules/ripple-lib/dist/npm/wallet/wallet-generation.js"));class ne extends c.EventEmitter{constructor(e={}){super(),this.generateAddress=z.generateAddress,this.generateXAddress=z.generateXAddress,this.connect=d.connect,this.disconnect=d.disconnect,this.isConnected=d.isConnected,this.getServerInfo=Y.getServerInfo,this.getFee=Y.getFee,this.getLedgerVersion=d.getLedgerVersion,this.getTransaction=h.default,this.getTransactions=f.default,this.getTrustlines=p.default,this.getBalances=m.default,this.getBalanceSheet=g.default,this.getPaths=y.default,this.getOrderbook=v.getOrderbook,this.getOrders=b.default,this.getSettings=_.getSettings,this.getAccountInfo=w.default,this.getAccountObjects=M.default,this.getPaymentChannel=j.default,this.getLedger=X.default,this.parseAccountFlags=_.parseAccountFlags,this.preparePayment=S.default,this.prepareTrustline=A.default,this.prepareOrder=E.default,this.prepareOrderCancellation=x.default,this.prepareEscrowCreation=O.default,this.prepareEscrowExecution=T.default,this.prepareEscrowCancellation=P.default,this.preparePaymentChannelCreate=k.default,this.preparePaymentChannelFund=I.default,this.preparePaymentChannelClaim=R.default,this.prepareCheckCreate=N.default,this.prepareCheckCash=B.default,this.prepareCheckCancel=C.default,this.prepareTicketCreate=F.default,this.prepareSettings=L.default,this.sign=D.default,this.combine=q.default,this.submit=U.default,this.deriveKeypair=V.deriveKeypair,this.deriveAddress=V.deriveAddress,this.computeLedgerHash=$.default,this.signPaymentChannelClaim=H.default,this.verifyPaymentChannelClaim=K.default,this.generateFaucetWallet=re.default,this.errors=l.errors,this.xrpToDrops=l.xrpToDrops,this.dropsToXrp=l.dropsToXrp,this.rippleTimeToISO8601=l.rippleTimeToISO8601,this.iso8601ToRippleTime=l.iso8601ToRippleTime,this.txFlags=l.txFlags,this.accountSetFlags=l.constants.AccountSetFlags,this.isValidAddress=W.isValidAddress,this.isValidSecret=W.isValidSecret,l.validate.apiOptions(e),this._feeCushion=e.feeCushion||1.2,this._maxFeeXRP=e.maxFeeXRP||"2";const t=e.server;null!=t?(this.connection=new l.Connection(t,e),this.connection.on("ledgerClosed",(e=>{this.emit("ledger",d.formatLedgerClose(e))})),this.connection.on("error",((e,t,r)=>{this.emit("error",e,t,r)})),this.connection.on("connected",(()=>{this.emit("connected")})),this.connection.on("disconnected",(e=>{let t=e;1005!==t&&4e3!==t||(t=1e3),this.emit("disconnected",t)}))):this.connection=new l.Connection(null,e)}request(e,t={}){return a(this,void 0,void 0,(function*(){return this.connection.request(Object.assign(Object.assign({},t),{command:e,account:t.account?l.ensureClassicAddress(t.account):void 0}))}))}hasNextPage(e){return!!e.marker}requestNextPage(e,t={},r){return a(this,void 0,void 0,(function*(){if(!r.marker)return n.reject(new l.errors.NotFoundError("response does not have a next page"));const i=Object.assign({},t,{marker:r.marker});return this.request(e,i)}))}prepareTransaction(e,t={}){return a(this,void 0,void 0,(function*(){return G.prepareTransaction(e,this,t)}))}convertStringToHex(e){return G.convertStringToHex(e)}_requestAll(e,t={},r={}){return a(this,void 0,void 0,(function*(){const n=r.collect||function(e){switch(e){case"account_offers":case"book_offers":return"offers";case"account_lines":return"lines";default:return}}(e);if(!n)throw new l.errors.ValidationError(`no collect key for command ${e}`);const i=null!=t.limit?t.limit:1/0;let o,s=0,a=t.marker;const u=[];do{const r=Q.clamp(i-s,10,400),c=Object.assign(Object.assign({},t),{limit:r,marker:a}),l=yield this.request(e,c),d=l[n];a=l.marker,u.push(l);Array.isArray(d)?(s+=d.length,o=d.length):o=0}while(a&&snew o.RippleAPI(Object.assign({},t,{server:e}))));this._apis=r,this.getMethodNames().forEach((e=>{this[e]=function(){return n.race(r.map((t=>t[e](...arguments))))}})),this.connect=function(){return i(this,void 0,void 0,(function*(){yield n.all(r.map((e=>e.connect())))}))},this.disconnect=function(){return i(this,void 0,void 0,(function*(){yield n.all(r.map((e=>e.disconnect())))}))},this.isConnected=function(){return r.map((e=>e.isConnected())).every(Boolean)};const s=r[0];["sign","generateAddress","computeLedgerHash"].forEach((e=>{this[e]=s[e].bind(s)})),r.forEach((e=>{e.on("ledger",this.onLedgerEvent.bind(this)),e.on("error",((e,t,r)=>this.emit("error",e,t,r)))}))}onLedgerEvent(e){(e.ledgerVersion>this.ledgerVersion||null==this.ledgerVersion)&&(this.ledgerVersion=e.ledgerVersion,this.emit("ledger",e))}getMethodNames(){const e=[],t=this._apis[0];for(const r of Object.getOwnPropertyNames(t))"function"==typeof t[r]&&e.push(r);return e}}t.RippleAPIBroadcast=s},"../../node_modules/ripple-lib/dist/npm/common/backoff.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExponentialBackoff=void 0;t.ExponentialBackoff=class{constructor(e={}){this.factor=2,this.jitter=0,this.attempts=0,this.ms=e.min||100,this.max=e.max||1e4}duration(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-r:e+r}return 0|Math.min(e,this.max)}reset(){this.attempts=0}}},"../../node_modules/ripple-lib/dist/npm/common/browser-hacks.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setPrototypeOf=t.getConstructorName=void 0,t.setPrototypeOf=function(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t},t.getConstructorName=function(e){if(e.constructor.name)return e.constructor.name;const t=e.constructor.toString(),r=t.match(/^function\s+([^(]*)/),n=t.match(/^class\s([^\s]*)/);return r?r[1]:n[1]}},"../../node_modules/ripple-lib/dist/npm/common/connection.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,Buffer=r("../../node_modules/buffer/index.js").Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0;const c=s(r("../../node_modules/lodash/lodash.js")),l=r("../../node_modules/events/events.js"),d=r("../../node_modules/url/url.js"),h=u(r("../../node_modules/ripple-lib/dist/npm/common/wswrapper.js")),f=u(r("../../node_modules/ripple-lib/dist/npm/common/rangeset.js")),p=r("../../node_modules/ripple-lib/dist/npm/common/errors.js"),m=r("../../node_modules/ripple-lib/dist/npm/common/backoff.js");class g{constructor(){this.feeBase=null,this.feeRef=null,this.latestVersion=null,this.reserveBase=null,this.availableVersions=new f.default}hasVersion(e){return this.availableVersions.containsValue(e)}hasVersions(e,t){return this.availableVersions.containsRange(e,t)}update(e){this.feeBase=e.fee_base,this.feeRef=e.fee_ref,this.latestVersion=e.ledger_index,this.reserveBase=e.reserve_base,e.validated_ledgers?(this.availableVersions.reset(),this.availableVersions.parseAndAddRanges(e.validated_ledgers)):this.availableVersions.addValue(this.latestVersion)}}class y{constructor(){this.promisesAwaitingConnection=[]}resolveAllAwaiting(){this.promisesAwaitingConnection.map((({resolve:e})=>e())),this.promisesAwaitingConnection=[]}rejectAllAwaiting(e){this.promisesAwaitingConnection.map((({reject:t})=>t(e))),this.promisesAwaitingConnection=[]}awaitConnection(){return new n(((e,t)=>{this.promisesAwaitingConnection.push({resolve:e,reject:t})}))}}class b{constructor(){this.nextId=0,this.promisesAwaitingResponse=[]}cancel(e){const{timer:t}=this.promisesAwaitingResponse[e];clearTimeout(t),delete this.promisesAwaitingResponse[e]}resolve(e,t){const{timer:r,resolve:n}=this.promisesAwaitingResponse[e];clearTimeout(r),n(t),delete this.promisesAwaitingResponse[e]}reject(e,t){const{timer:r,reject:n}=this.promisesAwaitingResponse[e];clearTimeout(r),n(t),delete this.promisesAwaitingResponse[e]}rejectAll(e){this.promisesAwaitingResponse.forEach(((t,r)=>{this.reject(r,e)}))}createRequest(e,t){const r=this.nextId++,i=JSON.stringify(Object.assign(Object.assign({},e),{id:r})),o=setTimeout((()=>this.reject(r,new p.TimeoutError)),t);o.unref&&o.unref();const s=new n(((e,t)=>{this.promisesAwaitingResponse[r]={resolve:e,reject:t,timer:o}}));return[r,i,s]}handleResponse(e){if(!Number.isInteger(e.id)||e.id<0)throw new p.ResponseFormatError("valid id not found in response",e);if(this.promisesAwaitingResponse[e.id])if("error"!==e.status)if("success"===e.status)this.resolve(e.id,e.result);else{const t=new p.ResponseFormatError(`unrecognized status: ${e.status}`,e);this.reject(e.id,t)}else{const t=new p.RippledError(e.error_message||e.error,e);this.reject(e.id,t)}}}class v extends l.EventEmitter{constructor(e,t={}){super(),this._ws=null,this._reconnectTimeoutID=null,this._heartbeatIntervalID=null,this._retryConnectionBackoff=new m.ExponentialBackoff({min:100,max:6e4}),this._trace=()=>{},this._ledger=new g,this._requestManager=new b,this._connectionManager=new y,this._clearHeartbeatInterval=()=>{clearInterval(this._heartbeatIntervalID)},this._startHeartbeatInterval=()=>{this._clearHeartbeatInterval(),this._heartbeatIntervalID=setInterval((()=>this._heartbeat()),this._config.timeout)},this._heartbeat=()=>this.request({command:"ping"}).catch((()=>this.reconnect().catch((e=>{this.emit("error","reconnect",e.message,e)})))),this._onConnectionFailed=e=>{this._ws&&(this._ws.removeAllListeners(),this._ws.on("error",(()=>{})),this._ws.close(),this._ws=null),"number"==typeof e?this._connectionManager.rejectAllAwaiting(new p.NotConnectedError(`Connection failed with code ${e}.`,{code:e})):e&&e.message?this._connectionManager.rejectAllAwaiting(new p.NotConnectedError(e.message,e)):this._connectionManager.rejectAllAwaiting(new p.NotConnectedError("Connection failed."))},this.setMaxListeners(1/0),this._url=e,this._config=Object.assign({timeout:2e4,connectionTimeout:5e3},t),"function"==typeof t.trace?this._trace=t.trace:!0===t.trace&&(this._trace=console.log)}_onMessage(e){let t;this._trace("receive",e);try{t=JSON.parse(e)}catch(t){return void this.emit("error","badMessage",t.message,e)}if(null==t.type&&t.error)this.emit("error",t.error,t.error_message,t);else if(t.type&&this.emit(t.type,t),"ledgerClosed"===t.type&&this._ledger.update(t),"response"===t.type)try{this._requestManager.handleResponse(t)}catch(t){this.emit("error","badMessage",t.message,e)}}get _state(){return this._ws?this._ws.readyState:h.default.CLOSED}get _shouldBeConnected(){return null!==this._ws}_waitForReady(){return new n(((e,t)=>{this._shouldBeConnected?this._state===h.default.OPEN?e():this.once("connected",(()=>e())):t(new p.NotConnectedError)}))}_subscribeToLedger(){return a(this,void 0,void 0,(function*(){const e=yield this.request({command:"subscribe",streams:["ledger"]});if(c.isEmpty(e)||!e.ledger_index)try{yield this.disconnect()}catch(e){}finally{throw new p.RippledNotInitializedError("Rippled not initialized")}this._ledger.update(e)}))}isConnected(){return this._state===h.default.OPEN}connect(){if(this.isConnected())return n.resolve();if(this._state===h.default.CONNECTING)return this._connectionManager.awaitConnection();if(!this._url)return n.reject(new p.ConnectionError("Cannot connect because no server was specified"));if(this._ws)return n.reject(new p.RippleError("Websocket connection never cleaned up.",{state:this._state}));const e=setTimeout((()=>{this._onConnectionFailed(new p.ConnectionError(`Error: connect() timed out after ${this._config.connectionTimeout} ms. If your internet connection is working, the rippled server may be blocked or inaccessible. You can also try setting the 'connectionTimeout' option in the RippleAPI constructor.`))}),this._config.connectionTimeout);return this._ws=function(e,t){const n={};if(null!=t.agent&&(n.agent=t.agent),null!=t.proxy){const i=d.parse(e),o=d.parse(t.proxy),s=c.omitBy({secureEndpoint:"wss:"===i.protocol,secureProxy:"https:"===o.protocol,auth:t.proxyAuthorization,ca:t.trustedCertificates,key:t.key,passphrase:t.passphrase,cert:t.certificate},(e=>null==e)),a=Object.assign({},o,s);let u;try{u=r("?0a88")}catch(e){throw new Error('"proxy" option is not supported in the browser')}n.agent=new u(a)}if(null!=t.authorization){const e=Buffer.from(t.authorization).toString("base64");n.headers={Authorization:`Basic ${e}`}}const i=c.omitBy({ca:t.trustedCertificates,key:t.key,passphrase:t.passphrase,cert:t.certificate},(e=>null==e)),o=Object.assign({},n,i),s=new h.default(e,null,o);return"function"==typeof s.setMaxListeners&&s.setMaxListeners(1/0),s}(this._url,this._config),this._ws.on("error",this._onConnectionFailed),this._ws.on("error",(()=>clearTimeout(e))),this._ws.on("close",this._onConnectionFailed),this._ws.on("close",(()=>clearTimeout(e))),this._ws.once("open",(()=>a(this,void 0,void 0,(function*(){this._ws.removeAllListeners(),clearTimeout(e),this._ws.on("message",(e=>this._onMessage(e))),this._ws.on("error",(e=>this.emit("error","websocket",e.message,e))),this._ws.once("close",(e=>{if(this._clearHeartbeatInterval(),this._requestManager.rejectAll(new p.DisconnectedError("websocket was closed")),this._ws.removeAllListeners(),this._ws=null,this.emit("disconnected",e),4e3!==e){const e=this._retryConnectionBackoff.duration();this._trace("reconnect",`Retrying connection in ${e}ms.`),this.emit("reconnecting",this._retryConnectionBackoff.attempts),this._reconnectTimeoutID=setTimeout((()=>{this.reconnect().catch((e=>{this.emit("error","reconnect",e.message,e)}))}),e)}}));try{this._retryConnectionBackoff.reset(),yield this._subscribeToLedger(),this._startHeartbeatInterval(),this._connectionManager.resolveAllAwaiting(),this.emit("connected")}catch(e){this._connectionManager.rejectAllAwaiting(e),yield this.disconnect().catch((()=>{}))}})))),this._connectionManager.awaitConnection()}disconnect(){return clearTimeout(this._reconnectTimeoutID),this._reconnectTimeoutID=null,this._state!==h.default.CLOSED&&this._ws?new n((e=>{this._ws.once("close",(t=>e(t))),this._state!==h.default.CLOSING&&this._ws.close(4e3)})):n.resolve(void 0)}reconnect(){return a(this,void 0,void 0,(function*(){this.emit("reconnect"),yield this.disconnect(),yield this.connect()}))}getFeeBase(){return a(this,void 0,void 0,(function*(){return yield this._waitForReady(),this._ledger.feeBase}))}getFeeRef(){return a(this,void 0,void 0,(function*(){return yield this._waitForReady(),this._ledger.feeRef}))}getLedgerVersion(){return a(this,void 0,void 0,(function*(){return yield this._waitForReady(),this._ledger.latestVersion}))}getReserveBase(){return a(this,void 0,void 0,(function*(){return yield this._waitForReady(),this._ledger.reserveBase}))}hasLedgerVersions(e,t){return a(this,void 0,void 0,(function*(){return t?(yield this._waitForReady(),this._ledger.hasVersions(e,t)):this.hasLedgerVersion(e)}))}hasLedgerVersion(e){return a(this,void 0,void 0,(function*(){return yield this._waitForReady(),this._ledger.hasVersion(e)}))}request(e,t){return a(this,void 0,void 0,(function*(){if(!this._shouldBeConnected)throw new p.NotConnectedError;const[r,i,o]=this._requestManager.createRequest(e,t||this._config.timeout);return this._trace("send",i),function(e,t){return new n(((r,n)=>{e.send(t,void 0,(e=>{e?n(new p.DisconnectedError(e.message,e)):r()}))}))}(this._ws,i).catch((e=>{this._requestManager.reject(r,e)})),o}))}getUrl(){return this._url}}t.Connection=v},"../../node_modules/ripple-lib/dist/npm/common/constants.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccountFlags=t.AccountSetFlags=t.AccountFields=void 0;const n=r("../../node_modules/ripple-lib/dist/npm/common/txflags.js"),i={passwordSpent:65536,requireDestinationTag:131072,requireAuthorization:262144,depositAuth:16777216,disallowIncomingXRP:524288,disableMasterKey:1048576,noFreeze:2097152,globalFreeze:4194304,defaultRipple:8388608};t.AccountFlags=i;const o={requireDestinationTag:n.txFlagIndices.AccountSet.asfRequireDest,requireAuthorization:n.txFlagIndices.AccountSet.asfRequireAuth,depositAuth:n.txFlagIndices.AccountSet.asfDepositAuth,disallowIncomingXRP:n.txFlagIndices.AccountSet.asfDisallowXRP,disableMasterKey:n.txFlagIndices.AccountSet.asfDisableMaster,enableTransactionIDTracking:n.txFlagIndices.AccountSet.asfAccountTxnID,noFreeze:n.txFlagIndices.AccountSet.asfNoFreeze,globalFreeze:n.txFlagIndices.AccountSet.asfGlobalFreeze,defaultRipple:n.txFlagIndices.AccountSet.asfDefaultRipple};t.AccountSetFlags=o;t.AccountFields={EmailHash:{name:"emailHash",encoding:"hex",length:32,defaults:"00000000000000000000000000000000"},WalletLocator:{name:"walletLocator"},MessageKey:{name:"messageKey"},Domain:{name:"domain",encoding:"hex"},TransferRate:{name:"transferRate",defaults:0,shift:9},TickSize:{name:"tickSize",defaults:0}}},"../../node_modules/ripple-lib/dist/npm/common/errors.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.XRPLFaucetError=t.LedgerVersionError=t.MissingLedgerHistoryError=t.PendingLedgerVersionError=t.NotFoundError=t.ValidationError=t.ResponseFormatError=t.TimeoutError=t.RippledNotInitializedError=t.DisconnectedError=t.NotConnectedError=t.RippledError=t.ConnectionError=t.UnexpectedError=t.RippleError=void 0;const s=r("../../node_modules/util/util.js"),a=o(r("../../node_modules/ripple-lib/dist/npm/common/browser-hacks.js"));class u extends Error{constructor(e="",t){super(e),this.name=a.getConstructorName(this),this.message=e,this.data=t,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(){let e="["+this.name+"("+this.message;return this.data&&(e+=", "+s.inspect(this.data)),e+=")]",e}inspect(){return this.toString()}}t.RippleError=u;t.RippledError=class extends u{};t.UnexpectedError=class extends u{};t.LedgerVersionError=class extends u{};class c extends u{}t.ConnectionError=c;t.NotConnectedError=class extends c{};t.DisconnectedError=class extends c{};t.RippledNotInitializedError=class extends c{};t.TimeoutError=class extends c{};t.ResponseFormatError=class extends c{};t.ValidationError=class extends u{};t.XRPLFaucetError=class extends u{};t.NotFoundError=class extends u{constructor(e="Not found"){super(e)}};t.MissingLedgerHistoryError=class extends u{constructor(e){super(e||"Server is missing ledger history in the specified range")}};t.PendingLedgerVersionError=class extends u{constructor(e){super(e||"maxLedgerVersion is greater than server's most recent validated ledger")}}},"../../node_modules/ripple-lib/dist/npm/common/hashes/hash-prefix.js":(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.TRANSACTION_ID=1415073280]="TRANSACTION_ID",e[e.TRANSACTION_NODE=1397638144]="TRANSACTION_NODE",e[e.INNER_NODE=1296649728]="INNER_NODE",e[e.LEAF_NODE=1296846336]="LEAF_NODE",e[e.TRANSACTION_SIGN=1398036480]="TRANSACTION_SIGN",e[e.TRANSACTION_SIGN_TESTNET=1937012736]="TRANSACTION_SIGN_TESTNET",e[e.TRANSACTION_MULTISIGN=1397576704]="TRANSACTION_MULTISIGN",e[e.LEDGER=1280791040]="LEDGER"}(r||(r={})),t.default=r},"../../node_modules/ripple-lib/dist/npm/common/hashes/index.js":function(e,t,r){"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.computePaymentChannelHash=t.computeEscrowHash=t.computeLedgerHash=t.computeStateTreeHash=t.computeTransactionTreeHash=t.computeTrustlineHash=t.computeOrderID=t.computeSignerListLedgerObjectID=t.computeAccountLedgerObjectID=t.computeBinaryTransactionSigningHash=t.computeTransactionHash=t.computeBinaryTransactionHash=void 0;const i=n(r("../../node_modules/bignumber.js/bignumber.js")),o=r("../../node_modules/ripple-address-codec/dist/index.js"),s=n(r("../../node_modules/ripple-lib/dist/npm/common/hashes/sha512Half.js")),a=n(r("../../node_modules/ripple-lib/dist/npm/common/hashes/hash-prefix.js")),u=r("../../node_modules/ripple-lib/dist/npm/common/hashes/shamap.js"),c=r("../../node_modules/ripple-binary-codec/dist/index.js"),l=n(r("../../node_modules/ripple-lib/dist/npm/common/hashes/ledgerspaces.js")),d=(e,t)=>Array(t-e.length+1).join("0")+e,h=(e,t)=>d(Number(e).toString(16),2*t),f=e=>Buffer.from(e).toString("hex"),p=e=>h(l.default[e].charCodeAt(0),2),m=e=>Buffer.from(o.decodeAccountID(e)).toString("hex"),g=e=>{const t=e.length/2;if(t<=192)return f([t])+e;if(t<=12480){const r=t-193;return f([193+(r>>>8),255&r])+e}if(t<=918744){const r=t-12481;return f([241+(r>>>16),r>>>8&255,255&r])+e}throw new Error("Variable integer overflow.")};t.computeBinaryTransactionHash=e=>{const t=a.default.TRANSACTION_ID.toString(16).toUpperCase();return s.default(t+e)},t.computeTransactionHash=e=>t.computeBinaryTransactionHash(c.encode(e)),t.computeBinaryTransactionSigningHash=e=>{const t=a.default.TRANSACTION_SIGN.toString(16).toUpperCase();return s.default(t+e)},t.computeAccountLedgerObjectID=e=>s.default(p("account")+m(e)),t.computeSignerListLedgerObjectID=e=>s.default(p("signerList")+m(e)+"00000000"),t.computeOrderID=(e,t)=>{const r="00"+h(l.default.offer.charCodeAt(0),1);return s.default(r+m(e)+h(t,4))},t.computeTrustlineHash=(e,t,r)=>{const n=m(e),o=m(t),a=new i.default(n,16).isGreaterThan(new i.default(o,16)),u=a?o:n,c=a?n:o,l=p("rippleState");return s.default(l+u+c+(e=>{if(3===e.length){const t=new Array(21).join("0").split("").map(parseFloat);return t[12]=255&e.charCodeAt(0),t[13]=255&e.charCodeAt(1),t[14]=255&e.charCodeAt(2),f(t)}return e})(r))},t.computeTransactionTreeHash=e=>{const r=new u.SHAMap;return e.forEach((e=>{const n=c.encode(e),i=c.encode(e.metaData),o=t.computeBinaryTransactionHash(n),s=g(n)+g(i);r.addItem(o,s,u.NodeType.TRANSACTION_METADATA)})),r.hash},t.computeStateTreeHash=e=>{const t=new u.SHAMap;return e.forEach((e=>{const r=c.encode(e);t.addItem(e.index,r,u.NodeType.ACCOUNT_STATE)})),t.hash},t.computeLedgerHash=e=>{const t=a.default.LEDGER.toString(16).toUpperCase();return s.default(t+h(e.ledger_index,4)+((e,t)=>{const r=new i.default(e).toString(16);return d(r,2*t)})(e.total_coins,8)+e.parent_hash+e.transaction_hash+e.account_hash+h(e.parent_close_time,4)+h(e.close_time,4)+h(e.close_time_resolution,1)+h(e.close_flags,1))},t.computeEscrowHash=(e,t)=>s.default(p("escrow")+m(e)+h(t,4)),t.computePaymentChannelHash=(e,t,r)=>s.default(p("paychan")+m(e)+m(t)+h(r,4))},"../../node_modules/ripple-lib/dist/npm/common/hashes/ledgerspaces.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={account:"a",dirNode:"d",generatorMap:"g",rippleState:"r",offer:"o",ownerDir:"O",bookDir:"B",contract:"c",skipList:"s",escrow:"u",amendment:"f",feeSettings:"e",ticket:"T",signerList:"S",paychan:"x",check:"C",depositPreauth:"p"}},"../../node_modules/ripple-lib/dist/npm/common/hashes/sha512Half.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer;Object.defineProperty(t,"__esModule",{value:!0});const n=r("../../node_modules/crypto-browserify/index.js");t.default=e=>n.createHash("sha512").update(Buffer.from(e,"hex")).digest("hex").toUpperCase().slice(0,64)},"../../node_modules/ripple-lib/dist/npm/common/hashes/shamap.js":function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SHAMap=t.Leaf=t.InnerNode=t.Node=t.NodeType=void 0;const i=n(r("../../node_modules/ripple-lib/dist/npm/common/hashes/hash-prefix.js")),o=n(r("../../node_modules/ripple-lib/dist/npm/common/hashes/sha512Half.js")),s="0000000000000000000000000000000000000000000000000000000000000000";var a;!function(e){e[e.INNER=1]="INNER",e[e.TRANSACTION_NO_METADATA=2]="TRANSACTION_NO_METADATA",e[e.TRANSACTION_METADATA=3]="TRANSACTION_METADATA",e[e.ACCOUNT_STATE=4]="ACCOUNT_STATE"}(a=t.NodeType||(t.NodeType={}));class u{constructor(){}addItem(e,t){throw new Error("Called unimplemented virtual method SHAMapTreeNode#addItem.")}get hash(){throw new Error("Called unimplemented virtual method SHAMapTreeNode#hash.")}}t.Node=u;class c extends u{constructor(e=0){super(),this.leaves={},this.type=a.INNER,this.depth=e,this.empty=!0}addItem(e,t){const r=this.getNode(parseInt(e[this.depth],16));if(r){if(r instanceof c)r.addItem(e,t);else if(r instanceof l){if(r.tag===e)throw new Error("Tried to add a node to a SHAMap that was already in there.");{const n=new c(this.depth+1);n.addItem(r.tag,r),n.addItem(e,t),this.setNode(parseInt(e[this.depth],16),n)}}}else this.setNode(parseInt(e[this.depth],16),t)}setNode(e,t){if(e<0||e>15)throw new Error("Invalid slot: slot must be between 0-15.");this.leaves[e]=t,this.empty=!1}getNode(e){if(e<0||e>15)throw new Error("Invalid slot: slot must be between 0-15.");return this.leaves[e]}get hash(){if(this.empty)return s;let e="";for(let t=0;t<16;t++)e+=this.leaves[t]?this.leaves[t].hash:s;const t=i.default.INNER_NODE.toString(16);return o.default(t+e)}}t.InnerNode=c;class l extends u{constructor(e,t,r){super(),this.tag=e,this.type=r,this.data=t}get hash(){switch(this.type){case a.ACCOUNT_STATE:{const e=i.default.LEAF_NODE.toString(16);return o.default(e+this.data+this.tag)}case a.TRANSACTION_NO_METADATA:{const e=i.default.TRANSACTION_ID.toString(16);return o.default(e+this.data)}case a.TRANSACTION_METADATA:{const e=i.default.TRANSACTION_NODE.toString(16);return o.default(e+this.data+this.tag)}default:throw new Error("Tried to hash a SHAMap node of unknown type.")}}}t.Leaf=l;t.SHAMap=class{constructor(){this.root=new c(0)}addItem(e,t,r){this.root.addItem(e,new l(e,t,r))}get hash(){return this.root.hash}}},"../../node_modules/ripple-lib/dist/npm/common/index.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.serverInfo=t.validate=t.errors=t.constants=t.ensureClassicAddress=void 0;const s=o(r("../../node_modules/ripple-lib/dist/npm/common/constants.js"));t.constants=s;const a=o(r("../../node_modules/ripple-lib/dist/npm/common/errors.js"));t.errors=a;const u=o(r("../../node_modules/ripple-lib/dist/npm/common/validate.js"));t.validate=u;const c=o(r("../../node_modules/ripple-lib/dist/npm/common/serverinfo.js"));t.serverInfo=c;const l=r("../../node_modules/ripple-address-codec/dist/index.js");t.ensureClassicAddress=function(e){if(l.isValidXAddress(e)){const{classicAddress:t,tag:r}=l.xAddressToClassicAddress(e);if(!1!==r)throw new Error("This command does not support the use of a tag. Use an address without a tag.");return t}return e};var d=r("../../node_modules/ripple-lib/dist/npm/common/utils.js");Object.defineProperty(t,"dropsToXrp",{enumerable:!0,get:function(){return d.dropsToXrp}}),Object.defineProperty(t,"xrpToDrops",{enumerable:!0,get:function(){return d.xrpToDrops}}),Object.defineProperty(t,"toRippledAmount",{enumerable:!0,get:function(){return d.toRippledAmount}}),Object.defineProperty(t,"removeUndefined",{enumerable:!0,get:function(){return d.removeUndefined}}),Object.defineProperty(t,"convertKeysFromSnakeCaseToCamelCase",{enumerable:!0,get:function(){return d.convertKeysFromSnakeCaseToCamelCase}}),Object.defineProperty(t,"iso8601ToRippleTime",{enumerable:!0,get:function(){return d.iso8601ToRippleTime}}),Object.defineProperty(t,"rippleTimeToISO8601",{enumerable:!0,get:function(){return d.rippleTimeToISO8601}});var h=r("../../node_modules/ripple-lib/dist/npm/common/connection.js");Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return h.Connection}});var f=r("../../node_modules/ripple-lib/dist/npm/common/txflags.js");Object.defineProperty(t,"txFlags",{enumerable:!0,get:function(){return f.txFlags}})},"../../node_modules/ripple-lib/dist/npm/common/rangeset.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/lodash/lodash.js")),a=o(r("../../node_modules/assert/build/assert.js"));t.default=class{constructor(){this.reset()}reset(){this.ranges=[]}serialize(){return this.ranges.map((e=>e[0].toString()+"-"+e[1].toString())).join(",")}addRange(e,t){a.ok(e<=t,`invalid range ${e} <= ${t}`),this.ranges=function(e){const t=[[-1/0,-1/0]];return s.sortBy(e,(e=>e[0])).forEach((e=>{const r=t.pop();e[0]<=r[1]+1?t.push([r[0],Math.max(e[1],r[1])]):(t.push(r),t.push(e))})),t.slice(1)}(this.ranges.concat([[e,t]]))}addValue(e){this.addRange(e,e)}parseAndAddRanges(e){e.split(",").forEach((e=>{const t=e.split("-").map(Number);this.addRange(t[0],1===t.length?t[0]:t[1])}))}containsRange(e,t){return this.ranges.some((r=>r[0]<=e&&r[1]>=t))}containsValue(e){return this.containsRange(e,e)}}},"../../node_modules/ripple-lib/dist/npm/common/schema-validator.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.isValidAddress=t.isValidSecret=t.schemaValidate=void 0;const s=o(r("../../node_modules/lodash/lodash.js")),a=o(r("../../node_modules/assert/build/assert.js")),{Validator:u}=r("../../node_modules/jsonschema/lib/index.js"),c=r("../../node_modules/ripple-lib/dist/npm/common/errors.js"),l=r("../../node_modules/ripple-address-codec/dist/index.js"),d=r("../../node_modules/ripple-lib/dist/npm/common/utils.js");Object.defineProperty(t,"isValidSecret",{enumerable:!0,get:function(){return d.isValidSecret}});const h=function(){const e=[r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/tx-json.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/transaction-type.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/hash128.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/hash256.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/sequence.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/ticket-sequence.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/signature.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/issue.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/ledger-version.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/max-adjustment.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/memo.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/memos.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/public-key.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/private-key.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/uint32.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/value.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/source-adjustment.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/destination-adjustment.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/tag.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/lax-amount.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/lax-lax-amount.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/min-adjustment.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/source-exact-adjustment.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/destination-exact-adjustment.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/destination-address-tag.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/transaction-hash.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/address.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/x-address.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/classic-address.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/adjustment.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/quality.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/amount.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/amountbase.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/balance.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/blob.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/currency.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/signed-value.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/orderbook.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/instructions.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/objects/settings-plus-memos.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/settings.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/payment.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/get-payment.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/escrow-cancellation.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/order-cancellation.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/order.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/escrow-execution.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/escrow-creation.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/payment-channel-create.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/payment-channel-fund.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/payment-channel-claim.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/check-create.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/check-cash.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/check-cancel.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/trustline.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/deposit-preauth.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/account-delete.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/sign.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/submit.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-account-info.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-account-objects.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-balances.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-balance-sheet.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-ledger.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-orderbook.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-orders.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/order-change.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-payment-channel.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/prepare.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/ledger-event.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-paths.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-server-info.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-settings.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/orderbook-orders.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/outcome.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-transaction.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-transactions.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-trustlines.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/sign-payment-channel-claim.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/output/verify-payment-channel-claim.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-balances.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-balance-sheet.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-ledger.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-orders.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-orderbook.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-paths.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-payment-channel.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/api-options.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-settings.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-account-info.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-account-objects.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-transaction.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-transactions.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-trustlines.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-payment.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-order.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-trustline.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-order-cancellation.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-settings.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-escrow-creation.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-escrow-cancellation.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-escrow-execution.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-payment-channel-create.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-payment-channel-fund.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-payment-channel-claim.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-check-create.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-check-cash.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-check-cancel.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-ticket-create.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/compute-ledger-hash.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/sign.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/submit.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/generate-address.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/sign-payment-channel-claim.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/verify-payment-channel-claim.json"),r("../../node_modules/ripple-lib/dist/npm/common/schemas/input/combine.json")],t=e.map((e=>e.title)),n=Object.keys(s.pickBy(s.countBy(t),(e=>e>1)));a.ok(0===n.length,"Duplicate schemas for: "+n);const i=new u;return i.customFormats.xAddress=function(e){return null==e||l.isValidXAddress(e)},i.customFormats.classicAddress=function(e){return null==e||f(e)},i.customFormats.secret=function(e){return null==e||d.isValidSecret(e)},e.forEach((e=>i.addSchema(e,"/"+e.title))),i}();function f(e){return l.isValidXAddress(e)||l.isValidClassicAddress(e)}t.schemaValidate=function(e,t){const r=h.getSchema("/"+e);if(null==r)throw new c.ValidationError("no schema for "+e);const n=h.validate(t,r);if(!n.valid)throw new c.ValidationError(n.errors.join())},t.isValidAddress=f},"../../node_modules/ripple-lib/dist/npm/common/serverinfo.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getFee=t.getServerInfo=void 0;const s=r("../../node_modules/ripple-lib/dist/npm/common/utils.js"),a=o(r("../../node_modules/bignumber.js/bignumber.js"));function u(e,t){Object.entries(t).forEach((t=>{const[r,n]=t;e[n]=e[r],delete e[r]}))}t.getServerInfo=function(){return this.request("server_info").then((e=>{const t=s.convertKeysFromSnakeCaseToCamelCase(e.info);return u(t,{hostid:"hostID"}),t.validatedLedger&&(u(t.validatedLedger,{baseFeeXrp:"baseFeeXRP",reserveBaseXrp:"reserveBaseXRP",reserveIncXrp:"reserveIncrementXRP",seq:"ledgerVersion"}),t.validatedLedger.baseFeeXRP=t.validatedLedger.baseFeeXRP.toString(),t.validatedLedger.reserveBaseXRP=t.validatedLedger.reserveBaseXRP.toString(),t.validatedLedger.reserveIncrementXRP=t.validatedLedger.reserveIncrementXRP.toString()),t}))},t.getFee=function(e){return i(this,void 0,void 0,(function*(){null==e&&(e=this._feeCushion),null==e&&(e=1.2);const t=(yield this.request("server_info")).info,r=new a.default(t.validated_ledger.base_fee_xrp);null==t.load_factor&&(t.load_factor=1);let n=r.times(t.load_factor).times(e);return n=a.default.min(n,this._maxFeeXRP),new a.default(n.toFixed(6)).toString(10)}))}},"../../node_modules/ripple-lib/dist/npm/common/txflags.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.txFlagIndices=t.txFlags=void 0;t.txFlags={Universal:{FullyCanonicalSig:2147483648},AccountSet:{RequireDestTag:65536,OptionalDestTag:131072,RequireAuth:262144,OptionalAuth:524288,DisallowXRP:1048576,AllowXRP:2097152},TrustSet:{SetAuth:65536,NoRipple:131072,SetNoRipple:131072,ClearNoRipple:262144,SetFreeze:1048576,ClearFreeze:2097152},OfferCreate:{Passive:65536,ImmediateOrCancel:131072,FillOrKill:262144,Sell:524288},Payment:{NoRippleDirect:65536,PartialPayment:131072,LimitQuality:262144},PaymentChannelClaim:{Renew:65536,Close:131072}};t.txFlagIndices={AccountSet:{asfRequireDest:1,asfRequireAuth:2,asfDisallowXRP:3,asfDisableMaster:4,asfAccountTxnID:5,asfNoFreeze:6,asfGlobalFreeze:7,asfDefaultRipple:8,asfDepositAuth:9}}},"../../node_modules/ripple-lib/dist/npm/common/types/objects/ledger.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../../node_modules/ripple-lib/dist/npm/common/utils.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isValidSecret=t.iso8601ToRippleTime=t.rippleTimeToISO8601=t.removeUndefined=t.convertKeysFromSnakeCaseToCamelCase=t.toRippledAmount=t.xrpToDrops=t.dropsToXrp=void 0;const a=o(r("../../node_modules/lodash/lodash.js")),u=s(r("../../node_modules/bignumber.js/bignumber.js")),c=r("../../node_modules/ripple-keypairs/dist/index.js"),l=r("../../node_modules/ripple-lib/dist/npm/common/errors.js"),d=r("../../node_modules/ripple-address-codec/dist/index.js");function h(e){if("string"==typeof e){if(!e.match(/^-?[0-9]*\.?[0-9]*$/))throw new l.ValidationError(`xrpToDrops: invalid value '${e}', should be a number matching (^-?[0-9]*\\.?[0-9]*$).`);if("."===e)throw new l.ValidationError(`xrpToDrops: invalid value '${e}', should be a BigNumber or string-encoded number.`)}if(!(e=new u.default(e).toString(10)).match(/^-?[0-9.]+$/))throw new l.ValidationError(`xrpToDrops: failed sanity check - value '${e}', does not match (^-?[0-9.]+$).`);const t=e.split(".");if(t.length>2)throw new l.ValidationError(`xrpToDrops: failed sanity check - value '${e}' has too many decimal points.`);if((t[1]||"0").length>6)throw new l.ValidationError(`xrpToDrops: value '${e}' has too many decimal places.`);return new u.default(e).times(1e6).integerValue(u.default.ROUND_FLOOR).toString(10)}t.isValidSecret=function(e){try{return c.deriveKeypair(e),!0}catch(e){return!1}},t.dropsToXrp=function(e){if("string"==typeof e){if(!e.match(/^-?[0-9]*\.?[0-9]*$/))throw new l.ValidationError(`dropsToXrp: invalid value '${e}', should be a number matching (^-?[0-9]*\\.?[0-9]*$).`);if("."===e)throw new l.ValidationError(`dropsToXrp: invalid value '${e}', should be a BigNumber or string-encoded number.`)}if((e=new u.default(e).toString(10)).includes("."))throw new l.ValidationError(`dropsToXrp: value '${e}' has too many decimal places.`);if(!e.match(/^-?[0-9]+$/))throw new l.ValidationError(`dropsToXrp: failed sanity check - value '${e}', does not match (^-?[0-9]+$).`);return new u.default(e).dividedBy(1e6).toString(10)},t.xrpToDrops=h,t.toRippledAmount=function(e){if("string"==typeof e)return e;if("XRP"===e.currency)return h(e.value);if("drops"===e.currency)return e.value;let t=e.counterparty||e.issuer,r=!1;try{({classicAddress:t,tag:r}=d.xAddressToClassicAddress(t))}catch(e){}if(!1!==r)throw new l.ValidationError("Issuer X-address includes a tag");return{currency:e.currency,issuer:t,value:e.value}},t.convertKeysFromSnakeCaseToCamelCase=function e(t){if("object"==typeof t){const r=Array.isArray(t)?[]:{};let n;return Object.entries(t).reduce(((t,[r,i])=>{n=r;const o=/([a-zA-Z]_[a-zA-Z])/g;return o.test(r)&&(n=r.replace(o,(e=>e[0]+e[2].toUpperCase()))),t[n]=e(i),t}),r)}return t},t.removeUndefined=function(e){return a.omitBy(e,(e=>null==e))},t.rippleTimeToISO8601=function(e){return new Date((t=e,1e3*(t+946684800))).toISOString();var t},t.iso8601ToRippleTime=function(e){return t=Date.parse(e),Math.round(t/1e3)-946684800;var t}},"../../node_modules/ripple-lib/dist/npm/common/validate.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.tx_json=t.instructions=t.apiOptions=t.verifyPaymentChannelClaim=t.signPaymentChannelClaim=t.generateAddress=t.computeLedgerHash=t.submit=t.combine=t.sign=t.prepareTicketCreate=t.prepareCheckCancel=t.prepareCheckCash=t.prepareCheckCreate=t.preparePaymentChannelClaim=t.preparePaymentChannelFund=t.preparePaymentChannelCreate=t.prepareEscrowExecution=t.prepareEscrowCancellation=t.prepareEscrowCreation=t.prepareSettings=t.prepareTrustline=t.prepareOrderCancellation=t.prepareOrder=t.preparePayment=t.getLedger=t.getPaymentChannel=t.getTransaction=t.getOrderbook=t.getOrders=t.getBalanceSheet=t.getBalances=t.getTrustlines=t.getAccountInfo=t.getSettings=t.getTransactions=t.getPaths=void 0;const s=o(r("../../node_modules/lodash/lodash.js")),a=r("../../node_modules/ripple-lib/dist/npm/common/errors.js"),u=r("../../node_modules/ripple-lib/dist/npm/common/schema-validator.js");function c(e){if(null!=e&&null!=e.minLedgerVersion&&null!=e.maxLedgerVersion&&Number(e.minLedgerVersion)>Number(e.maxLedgerVersion))throw t="minLedgerVersion must not be greater than maxLedgerVersion",new a.ValidationError(t);var t}function l(e,t){u.schemaValidate(e,t),c(t.options)}t.getPaths=s.partial(u.schemaValidate,"getPathsParameters"),t.getTransactions=s.partial(l,"getTransactionsParameters"),t.getSettings=s.partial(l,"getSettingsParameters"),t.getAccountInfo=s.partial(l,"getAccountInfoParameters"),t.getTrustlines=s.partial(l,"getTrustlinesParameters"),t.getBalances=s.partial(l,"getBalancesParameters"),t.getBalanceSheet=s.partial(l,"getBalanceSheetParameters"),t.getOrders=s.partial(l,"getOrdersParameters"),t.getOrderbook=s.partial(l,"getOrderbookParameters"),t.getTransaction=s.partial(l,"getTransactionParameters"),t.getPaymentChannel=s.partial(l,"getPaymentChannelParameters"),t.getLedger=s.partial(l,"getLedgerParameters"),t.preparePayment=s.partial(u.schemaValidate,"preparePaymentParameters"),t.prepareOrder=s.partial(u.schemaValidate,"prepareOrderParameters"),t.prepareOrderCancellation=s.partial(u.schemaValidate,"prepareOrderCancellationParameters"),t.prepareTrustline=s.partial(u.schemaValidate,"prepareTrustlineParameters"),t.prepareSettings=s.partial(u.schemaValidate,"prepareSettingsParameters"),t.prepareEscrowCreation=s.partial(u.schemaValidate,"prepareEscrowCreationParameters"),t.prepareEscrowCancellation=s.partial(u.schemaValidate,"prepareEscrowCancellationParameters"),t.prepareEscrowExecution=s.partial(u.schemaValidate,"prepareEscrowExecutionParameters"),t.preparePaymentChannelCreate=s.partial(u.schemaValidate,"preparePaymentChannelCreateParameters"),t.preparePaymentChannelFund=s.partial(u.schemaValidate,"preparePaymentChannelFundParameters"),t.preparePaymentChannelClaim=s.partial(u.schemaValidate,"preparePaymentChannelClaimParameters"),t.prepareCheckCreate=s.partial(u.schemaValidate,"prepareCheckCreateParameters"),t.prepareCheckCash=s.partial(u.schemaValidate,"prepareCheckCashParameters"),t.prepareCheckCancel=s.partial(u.schemaValidate,"prepareCheckCancelParameters"),t.prepareTicketCreate=s.partial(u.schemaValidate,"prepareTicketParameters"),t.sign=s.partial(u.schemaValidate,"signParameters"),t.combine=s.partial(u.schemaValidate,"combineParameters"),t.submit=s.partial(u.schemaValidate,"submitParameters"),t.computeLedgerHash=s.partial(u.schemaValidate,"computeLedgerHashParameters"),t.generateAddress=s.partial(u.schemaValidate,"generateAddressParameters"),t.signPaymentChannelClaim=s.partial(u.schemaValidate,"signPaymentChannelClaimParameters"),t.verifyPaymentChannelClaim=s.partial(u.schemaValidate,"verifyPaymentChannelClaimParameters"),t.apiOptions=s.partial(u.schemaValidate,"api-options"),t.instructions=s.partial(u.schemaValidate,"instructions"),t.tx_json=s.partial(u.schemaValidate,"tx-json")},"../../node_modules/ripple-lib/dist/npm/common/wswrapper.js":(e,t,r)=>{"use strict";const n=r("../../node_modules/events/events.js");class i extends n.EventEmitter{constructor(e,t,r){super(),this.setMaxListeners(1/0),this._ws=new WebSocket(e),this._ws.onclose=()=>{this.emit("close")},this._ws.onopen=()=>{this.emit("open")},this._ws.onerror=e=>{this.emit("error",e)},this._ws.onmessage=e=>{this.emit("message",e.data)}}close(){1===this.readyState&&this._ws.close()}send(e){this._ws.send(e)}get readyState(){return this._ws.readyState}}i.CONNECTING=0,i.OPEN=1,i.CLOSING=2,i.CLOSED=3,e.exports=i},"../../node_modules/ripple-lib/dist/npm/index.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r("../../node_modules/ripple-lib/dist/npm/api.js"),t),i(r("../../node_modules/ripple-lib/dist/npm/transaction/types.js"),t),i(r("../../node_modules/ripple-lib/dist/npm/common/types/objects/ledger.js"),t),i(r("../../node_modules/ripple-lib/dist/npm/offline/utils.js"),t);var o=r("../../node_modules/ripple-lib/dist/npm/broadcast.js");Object.defineProperty(t,"RippleAPIBroadcast",{enumerable:!0,get:function(){return o.RippleAPIBroadcast}})},"../../node_modules/ripple-lib/dist/npm/ledger/accountinfo.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t={}){return i(this,void 0,void 0,(function*(){o.validate.getAccountInfo({address:e,options:t}),e=o.ensureClassicAddress(e);return function(e){const t=e.account_data;return o.removeUndefined({sequence:t.Sequence,xrpBalance:o.dropsToXrp(t.Balance),ownerCount:t.OwnerCount,previousInitiatedTransactionID:t.AccountTxnID,previousAffectingTransactionID:t.PreviousTxnID,previousAffectingTransactionLedgerVersion:t.PreviousTxnLgrSeq})}(yield this.request("account_info",{account:e,ledger_index:t.ledgerVersion||"validated"}))}))}},"../../node_modules/ripple-lib/dist/npm/ledger/accountobjects.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t={}){return i(this,void 0,void 0,(function*(){return yield this.request("account_objects",o.removeUndefined({account:e,type:t.type,ledger_hash:t.ledgerHash,ledger_index:t.ledgerIndex,limit:t.limit,marker:t.marker}))}))}},"../../node_modules/ripple-lib/dist/npm/ledger/balance-sheet.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),s=r("../../node_modules/ripple-lib/dist/npm/ledger/utils.js");t.default=function(e,t={}){return i(this,void 0,void 0,(function*(){o.validate.getBalanceSheet({address:e,options:t}),t=yield s.ensureLedgerVersion.call(this,t);return function(e){const t={};return null!=e.balances&&(t.balances=[],Object.entries(e.balances).forEach((e=>{const[r,n]=e;n.forEach((e=>{t.balances.push(Object.assign({counterparty:r},e))}))}))),null!=e.assets&&(t.assets=[],Object.entries(e.assets).forEach((([e,r])=>{r.forEach((r=>{t.assets.push(Object.assign({counterparty:e},r))}))}))),null!=e.obligations&&(t.obligations=Object.entries(e.obligations).map((([e,t])=>({currency:e,value:t})))),t}(yield this.request("gateway_balances",{account:e,strict:!0,hotwallet:t.excludeAddresses,ledger_index:t.ledgerVersion}))}))}},"../../node_modules/ripple-lib/dist/npm/ledger/balances.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/ledger/utils.js")),u=r("../../node_modules/ripple-lib/dist/npm/common/index.js");function c(e){return{currency:e.specification.currency,counterparty:e.specification.counterparty,value:e.state.balance}}t.default=function(e,t={}){return u.validate.getTrustlines({address:e,options:t}),e=u.ensureClassicAddress(e),n.all([(r=this.connection,i=t.ledgerVersion,null!=i&&null!==i?n.resolve(i):r.getLedgerVersion()).then((t=>a.getXRPBalance(this.connection,e,t))),this.getTrustlines(e,t)]).then((e=>function(e,t){const r=t.trustlines.map(c);if(!(e.counterparty||e.currency&&"XRP"!==e.currency)){const e={currency:"XRP",value:t.xrp};r.unshift(e)}if(e.limit&&r.length>e.limit){const t=r.length-e.limit;r.splice(-t,t)}return r}(t,{xrp:e[0],trustlines:e[1]})));var r,i}},"../../node_modules/ripple-lib/dist/npm/ledger/ledger.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),s=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/ledger.js");t.default=function(e={}){return i(this,void 0,void 0,(function*(){o.validate.getLedger({options:e});const t=yield this.request("ledger",{ledger_hash:e.ledgerHash,ledger_index:e.ledgerVersion||"validated",expand:e.includeAllData,transactions:e.includeTransactions,accounts:e.includeState});return s.parseLedger(t.ledger)}))}},"../../node_modules/ripple-lib/dist/npm/ledger/orderbook.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getOrderbook=t.formatBidsAndAsks=void 0;const c=s(r("../../node_modules/lodash/lodash.js")),l=s(r("../../node_modules/ripple-lib/dist/npm/ledger/utils.js")),d=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/orderbook-order.js"),h=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),f=u(r("../../node_modules/bignumber.js/bignumber.js"));function p(e,t){return t.specification.direction===e}function m(e,t){const r=t.specification.quantity;return i=e,(n=r).currency===i.currency&&n.counterparty===i.counterparty?t:function(e){const t=e.specification,r={quantity:t.totalPrice,totalPrice:t.quantity,direction:"buy"===t.direction?"sell":"buy"},n=c.merge({},t,r);return c.merge({},e,{specification:n})}(t);var n,i}function g(e,t){const r=t.sort(((e,t)=>new f.default(e.quality).comparedTo(t.quality))).map(d.parseOrderbookOrder).map(c.partial(m,e.base));return{bids:r.filter(c.partial(p,"buy")),asks:r.filter(c.partial(p,"sell"))}}function y(e,t,r,n,i){return a(this,void 0,void 0,(function*(){const o=l.renameCounterpartyToIssuerInOrder({taker_gets:n,taker_pays:i});return e._requestAll("book_offers",{taker_gets:o.taker_gets,taker_pays:o.taker_pays,ledger_index:r.ledgerVersion||"validated",limit:r.limit,taker:t})}))}t.formatBidsAndAsks=g,t.getOrderbook=function(e,t,r={}){return a(this,void 0,void 0,(function*(){h.validate.getOrderbook({address:e,orderbook:t,options:r});const[i,o]=yield n.all([y(this,e,r,t.base,t.counter),y(this,e,r,t.counter,t.base)]),s=c.flatMap(i,(e=>e.offers)),a=c.flatMap(o,(e=>e.offers));return g(t,[...s,...a])}))}},"../../node_modules/ripple-lib/dist/npm/ledger/orders.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const u=s(r("../../node_modules/lodash/lodash.js")),c=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),l=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/account-order.js");t.default=function(e,t={}){return a(this,void 0,void 0,(function*(){c.validate.getOrders({address:e,options:t});const r=yield this._requestAll("account_offers",{account:e,ledger_index:t.ledgerVersion||(yield this.getLedgerVersion()),limit:t.limit});return function(e,t){let r=[];for(const n of t){const t=n.offers.map((t=>l.parseAccountOrder(e,t)));r=r.concat(t)}return u.sortBy(r,(e=>e.properties.sequence))}(e,r)}))}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/account-delete.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/assert/build/assert.js")),a=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),u=r("../../node_modules/ripple-address-codec/dist/index.js"),c=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js");t.default=function(e){return s.ok("AccountDelete"===e.TransactionType),a.removeUndefined({memos:c.parseMemos(e),destination:e.Destination,destinationTag:e.DestinationTag,destinationXAddress:u.classicAddressToXAddress(e.Destination,null!=e.DestinationTag&&e.DestinationTag,!1)})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/account-order.js":function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseAccountOrder=void 0;const i=n(r("../../node_modules/bignumber.js/bignumber.js")),o=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js")),s=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),a=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),u=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/flags.js");t.parseAccountOrder=function(e,t){const r=0==(t.flags&u.orderFlags.Sell)?"buy":"sell",n=o.default(t.taker_gets),c=o.default(t.taker_pays),l="buy"===r?c:n,d="buy"===r?n:c,h=a.removeUndefined({direction:r,quantity:l,totalPrice:d,passive:0!=(t.flags&u.orderFlags.Passive)||void 0,expirationTime:s.parseTimestamp(t.expiration)}),f=t.quality?s.adjustQualityForXRP(t.quality.toString(),n.currency,c.currency):(p=n,m=c,new i.default(m.value).dividedBy(p.value).precision(16,i.default.ROUND_HALF_UP).toString());var p,m;return{specification:h,properties:{maker:e,sequence:t.seq,makerExchangeRate:f}}}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/account-trustline.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),i=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e){return{specification:i.removeUndefined({limit:e.limit,currency:e.currency,counterparty:e.account,qualityIn:n.parseQuality(e.quality_in)||void 0,qualityOut:n.parseQuality(e.quality_out)||void 0,ripplingDisabled:e.no_ripple,frozen:e.freeze,authorized:e.authorized}),counterparty:i.removeUndefined({limit:e.limit_peer,ripplingDisabled:e.no_ripple_peer,frozen:e.freeze_peer,authorized:e.peer_authorized}),state:{balance:e.balance}}}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/amendment.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{amendment:e.Amendment}}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/ripple-lib/dist/npm/common/index.js"));t.default=function(e){return"string"==typeof e?{currency:"XRP",value:s.dropsToXrp(e)}:{currency:e.currency,value:e.value,counterparty:e.issuer}}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/cancellation.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/assert/build/assert.js")),a=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js");t.default=function(e){return s.ok("OfferCancel"===e.TransactionType),{memos:a.parseMemos(e),orderSequence:e.OfferSequence}}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/check-cancel.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/assert/build/assert.js")),a=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),u=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js");t.default=function(e){return s.ok("CheckCancel"===e.TransactionType),a.removeUndefined({memos:u.parseMemos(e),checkID:e.CheckID})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/check-cash.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/assert/build/assert.js")),u=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),c=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js")),l=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js");t.default=function(e){return a.ok("CheckCash"===e.TransactionType),u.removeUndefined({memos:l.parseMemos(e),checkID:e.CheckID,amount:e.Amount&&c.default(e.Amount),deliverMin:e.DeliverMin&&c.default(e.DeliverMin)})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/check-create.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/assert/build/assert.js")),u=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),c=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),l=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js")),d=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js");t.default=function(e){return a.ok("CheckCreate"===e.TransactionType),c.removeUndefined({memos:d.parseMemos(e),destination:e.Destination,sendMax:l.default(e.SendMax),destinationTag:e.DestinationTag,expiration:e.Expiration&&u.parseTimestamp(e.Expiration),invoiceID:e.InvoiceID})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/deposit-preauth.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/assert/build/assert.js")),a=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),u=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js");t.default=function(e){return s.ok("DepositPreauth"===e.TransactionType),a.removeUndefined({memos:u.parseMemos(e),authorize:e.Authorize,unauthorize:e.Unauthorize})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/escrow-cancellation.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/assert/build/assert.js")),a=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),u=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e){return s.ok("EscrowCancel"===e.TransactionType),u.removeUndefined({memos:a.parseMemos(e),owner:e.Owner,escrowSequence:e.OfferSequence})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/escrow-creation.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/assert/build/assert.js")),u=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js")),c=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),l=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e){return a.ok("EscrowCreate"===e.TransactionType),l.removeUndefined({amount:u.default(e.Amount).value,destination:e.Destination,memos:c.parseMemos(e),condition:e.Condition,allowCancelAfter:c.parseTimestamp(e.CancelAfter),allowExecuteAfter:c.parseTimestamp(e.FinishAfter),sourceTag:e.SourceTag,destinationTag:e.DestinationTag})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/escrow-execution.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/assert/build/assert.js")),a=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),u=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e){return s.ok("EscrowFinish"===e.TransactionType),u.removeUndefined({memos:a.parseMemos(e),owner:e.Owner,escrowSequence:e.OfferSequence,condition:e.Condition,fulfillment:e.Fulfillment})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/fee-update.js":function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r("../../node_modules/bignumber.js/bignumber.js")),o=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),s=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js");t.default=function(e){const t=new i.default(e.BaseFee,16).toString();return{memos:s.parseMemos(e),baseFeeXRP:o.dropsToXrp(t),referenceFeeUnits:e.ReferenceFeeUnits,reserveBaseXRP:o.dropsToXrp(e.ReserveBase),reserveIncrementXRP:o.dropsToXrp(e.ReserveIncrement)}}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/fields.js":function(e,t,r){"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r("../../node_modules/bignumber.js/bignumber.js")),o=r("../../node_modules/ripple-lib/dist/npm/common/index.js").constants.AccountFields;function s(e,t){return"hex"!==e.encoding||e.length?e.shift?new i.default(t).shiftedBy(-e.shift).toNumber():t:Buffer.from(t,"hex").toString("ascii")}t.default=function(e){const t={};for(const r in o){const n=e[r];if(null!=n){const e=o[r];t[e.name]=s(e,n)}}return e.RegularKey&&(t.regularKey=e.RegularKey),e.signer_lists&&1===e.signer_lists.length&&(t.signers={},e.signer_lists[0].SignerQuorum&&(t.signers.threshold=e.signer_lists[0].SignerQuorum),e.signer_lists[0].SignerEntries&&(t.signers.weights=e.signer_lists[0].SignerEntries.map((e=>({address:e.SignerEntry.Account,weight:e.SignerEntry.SignerWeight}))))),t}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/flags.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trustlineFlags=t.orderFlags=void 0;t.orderFlags={Passive:65536,Sell:131072};t.trustlineFlags={LowReserve:65536,HighReserve:131072,LowAuth:262144,HighAuth:524288,LowNoRipple:1048576,HighNoRipple:2097152,LowFreeze:4194304,HighFreeze:8388608}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/ledger.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseLedger=void 0;const a=o(r("../../node_modules/lodash/lodash.js")),u=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),c=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/transaction.js"));function l(e,t){const r=Object.assign({},a.omit(t,"metaData"),{meta:t.metaData,ledger_index:e}),n=c.default(r,!0);return n.outcome.ledgerVersion||(n.outcome.ledgerVersion=e),n}t.parseLedger=function(e){const t=parseInt(e.ledger_index,10);return u.removeUndefined(Object.assign({stateHash:e.account_hash,closeTime:u.rippleTimeToISO8601(e.close_time),closeTimeResolution:e.close_time_resolution,closeFlags:e.close_flags,ledgerHash:e.ledger_hash,ledgerVersion:t,parentLedgerHash:e.parent_hash,parentCloseTime:u.rippleTimeToISO8601(e.parent_close_time),totalDrops:e.total_coins,transactionHash:e.transaction_hash},function(e,t){return a.isEmpty(e)?{}:"string"==typeof e[0]?{transactionHashes:e}:{transactions:e.map(a.partial(l,t))}}(e.transactions,t),(r=e.accountState,a.isEmpty(r)?{}:"string"==typeof r[0]?{stateHashes:r}:{rawState:JSON.stringify(r)})));var r}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/order.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/assert/build/assert.js")),u=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),c=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),l=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js")),d=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),h=d.txFlags.OfferCreate;t.default=function(e){a.ok("OfferCreate"===e.TransactionType);const t=0==(e.Flags&h.Sell)?"buy":"sell",r=l.default(e.TakerGets),n=l.default(e.TakerPays),i="buy"===t?n:r,o="buy"===t?r:n;return d.removeUndefined({memos:c.parseMemos(e),direction:t,quantity:i,totalPrice:o,passive:0!=(e.Flags&h.Passive)||void 0,immediateOrCancel:0!=(e.Flags&h.ImmediateOrCancel)||void 0,fillOrKill:0!=(e.Flags&h.FillOrKill)||void 0,expirationTime:u.parseTimestamp(e.Expiration)})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/orderbook-order.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseOrderbookOrder=void 0;const a=o(r("../../node_modules/lodash/lodash.js")),u=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),c=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),l=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/flags.js"),d=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js"));t.parseOrderbookOrder=function(e){const t=0==(e.Flags&l.orderFlags.Sell)?"buy":"sell",r=d.default(e.TakerGets),n=d.default(e.TakerPays),i="buy"===t?n:r,o="buy"===t?r:n,s=c.removeUndefined({direction:t,quantity:i,totalPrice:o,passive:0!=(e.Flags&l.orderFlags.Passive)||void 0,expirationTime:u.parseTimestamp(e.Expiration)}),h={maker:e.Account,sequence:e.Sequence,makerExchangeRate:u.adjustQualityForXRP(e.quality,r.currency,n.currency)},f=e.taker_gets_funded?d.default(e.taker_gets_funded):void 0,p=e.taker_pays_funded?d.default(e.taker_pays_funded):void 0,m=c.removeUndefined({fundedAmount:f,priceOfFundedAmount:p}),g=a.isEmpty(m)?void 0:m;return c.removeUndefined({specification:s,properties:h,state:g,data:e})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/pathfind.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/lodash/lodash.js")),u=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js"));function c(e,t){const r=Object.keys(t)[0],n=t[r];return a.set({address:e},r,function(e,t){return t.counterparty===e?a.omit(t,"counterparty"):t}(e,n))}t.default=function(e){const t=e.source_account,r=e.destination_account,n=e.destination_amount;return e.alternatives.map((e=>function(e,t,r,n){const i=null!=n.destination_amount?{source:{amount:u.default(n.source_amount)},destination:{minAmount:u.default(n.destination_amount)}}:{source:{maxAmount:u.default(n.source_amount)},destination:{amount:u.default(r)}};return{source:c(e,i.source),destination:c(t,i.destination),paths:JSON.stringify((o=n.paths_computed,o.map((e=>e.map((e=>a.omit(e,["type","type_hex"])))))))};var o}(t,r,n,e)))}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/payment-channel-claim.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/assert/build/assert.js")),u=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),c=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js")),l=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),d=u.txFlags.PaymentChannelClaim;t.default=function(e){return a.ok("PaymentChannelClaim"===e.TransactionType),u.removeUndefined({memos:l.parseMemos(e),channel:e.Channel,balance:e.Balance&&c.default(e.Balance).value,amount:e.Amount&&c.default(e.Amount).value,signature:e.Signature,publicKey:e.PublicKey,renew:Boolean(e.Flags&d.Renew)||void 0,close:Boolean(e.Flags&d.Close)||void 0})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/payment-channel-create.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/assert/build/assert.js")),u=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),c=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),l=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js"));t.default=function(e){return a.ok("PaymentChannelCreate"===e.TransactionType),c.removeUndefined({memos:u.parseMemos(e),amount:l.default(e.Amount).value,destination:e.Destination,settleDelay:e.SettleDelay,publicKey:e.PublicKey,cancelAfter:e.CancelAfter&&u.parseTimestamp(e.CancelAfter),sourceTag:e.SourceTag,destinationTag:e.DestinationTag})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/payment-channel-fund.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/assert/build/assert.js")),u=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),c=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),l=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js"));t.default=function(e){return a.ok("PaymentChannelFund"===e.TransactionType),c.removeUndefined({memos:u.parseMemos(e),channel:e.Channel,amount:l.default(e.Amount).value,expiration:e.Expiration&&u.parseTimestamp(e.Expiration)})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/payment-channel.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePaymentChannel=void 0;const n=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),i=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.parsePaymentChannel=function(e){return i.removeUndefined({memos:n.parseMemos(e),account:e.Account,amount:i.dropsToXrp(e.Amount),balance:i.dropsToXrp(e.Balance),destination:e.Destination,publicKey:e.PublicKey,settleDelay:e.SettleDelay,expiration:n.parseTimestamp(e.Expiration),cancelAfter:n.parseTimestamp(e.CancelAfter),sourceTag:e.SourceTag,destinationTag:e.DestinationTag,previousAffectingTransactionID:e.PreviousTxnID,previousAffectingTransactionLedgerVersion:e.PreviousTxnLgrSeq})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/payment.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/lodash/lodash.js")),u=o(r("../../node_modules/assert/build/assert.js")),c=o(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js")),l=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),d=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js"));function h(e){return 0!=(e.Flags&l.txFlags.Payment.NoRippleDirect)}function f(e){return 0!=(e.Flags&l.txFlags.Payment.LimitQuality)}t.default=function(e){u.ok("Payment"===e.TransactionType);const t={address:e.Account,maxAmount:(r=d.default(e.SendMax||e.Amount),n=e.Account,r.counterparty===n?a.omit(r,"counterparty"):r),tag:e.SourceTag};var r,n;const i={address:e.Destination,tag:e.DestinationTag};return l.removeUndefined({source:l.removeUndefined(t),destination:l.removeUndefined(i),memos:c.parseMemos(e),invoiceID:e.InvoiceID,paths:e.Paths?JSON.stringify(e.Paths):void 0,allowPartialPayment:c.isPartialPayment(e)||void 0,noDirectRipple:h(e)||void 0,limitQuality:f(e)||void 0})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/settings.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/lodash/lodash.js")),u=o(r("../../node_modules/assert/build/assert.js")),c=r("../../node_modules/ripple-lib/dist/npm/common/index.js").constants.AccountFlags,l=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/fields.js"));function d(e){const t={};if("AccountSet"!==e.TransactionType)return t;const r=function(e){const t=e.meta.AffectedNodes.filter((e=>{var t;return"AccountRoot"===(null===(t=e.ModifiedNode)||void 0===t?void 0:t.LedgerEntryType)}));return u.ok(1===t.length),t[0].ModifiedNode}(e),n=a.get(r.PreviousFields,"Flags"),i=a.get(r.FinalFields,"Flags");if(null!=n&&null!=i){const e=n^i,r=i&e,o=n&e;Object.entries(c).forEach((e=>{const[n,i]=e;r&i?t[n]=!0:o&i&&(t[n]=!1)}))}const o=a.get(r.PreviousFields,"AccountTxnID"),s=a.get(r.FinalFields,"AccountTxnID");return s&&!o?t.enableTransactionIDTracking=!0:o&&!s&&(t.enableTransactionIDTracking=!1),t}t.default=function(e){const t=e.TransactionType;return u.ok("AccountSet"===t||"SetRegularKey"===t||"SignerListSet"===t),Object.assign({},d(e),l.default(e))}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/ticket-create.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/assert/build/assert.js")),a=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),u=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js");t.default=function(e){return s.ok("TicketCreate"===e.TransactionType),a.removeUndefined({memos:u.parseMemos(e),ticketCount:e.TicketCount})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/transaction.js":function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),o=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),s=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/settings.js")),a=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/account-delete.js")),u=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/check-cancel.js")),c=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/check-cash.js")),l=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/check-create.js")),d=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/deposit-preauth.js")),h=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/escrow-cancellation.js")),f=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/escrow-creation.js")),p=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/escrow-execution.js")),m=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/cancellation.js")),g=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/order.js")),y=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/payment.js")),b=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/payment-channel-claim.js")),v=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/payment-channel-create.js")),_=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/payment-channel-fund.js")),w=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/ticket-create.js")),M=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/trustline.js")),j=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amendment.js")),S=n(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/fee-update.js"));t.default=function(e,t){const r=function(e){return{AccountSet:"settings",AccountDelete:"accountDelete",CheckCancel:"checkCancel",CheckCash:"checkCash",CheckCreate:"checkCreate",DepositPreauth:"depositPreauth",EscrowCancel:"escrowCancellation",EscrowCreate:"escrowCreation",EscrowFinish:"escrowExecution",OfferCancel:"orderCancellation",OfferCreate:"order",Payment:"payment",PaymentChannelClaim:"paymentChannelClaim",PaymentChannelCreate:"paymentChannelCreate",PaymentChannelFund:"paymentChannelFund",SetRegularKey:"settings",SignerListSet:"settings",TicketCreate:"ticketCreate",TrustSet:"trustline",EnableAmendment:"amendment",SetFee:"feeUpdate"}[e]||null}(e.TransactionType),n={settings:s.default,accountDelete:a.default,checkCancel:u.default,checkCash:c.default,checkCreate:l.default,depositPreauth:d.default,escrowCancellation:h.default,escrowCreation:f.default,escrowExecution:p.default,orderCancellation:m.default,order:g.default,payment:y.default,paymentChannelClaim:b.default,paymentChannelCreate:v.default,paymentChannelFund:_.default,ticketCreate:w.default,trustline:M.default,amendment:j.default,feeUpdate:S.default}[r],A=n?n(e):{UNAVAILABLE:"Unrecognized transaction type.",SEE_RAW_TRANSACTION:"Since this type is unrecognized, `rawTransaction` is included in this response."};n||(t=!0);const E=i.parseOutcome(e);return o.removeUndefined({type:r,address:e.Account,sequence:e.Sequence,id:e.hash,specification:o.removeUndefined(A),outcome:E?o.removeUndefined(E):void 0,rawTransaction:t?JSON.stringify(e):void 0})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/trustline.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/assert/build/assert.js")),a=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js"),u=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),c=u.txFlags.TrustSet;function l(e,t,r){return!!(e&t)||!(e&r)&&void 0}t.default=function(e){return s.ok("TrustSet"===e.TransactionType),u.removeUndefined({limit:e.LimitAmount.value,currency:e.LimitAmount.currency,counterparty:e.LimitAmount.issuer,memos:a.parseMemos(e),qualityIn:a.parseQuality(e.QualityIn),qualityOut:a.parseQuality(e.QualityOut),ripplingDisabled:l(e.Flags,c.SetNoRipple,c.ClearNoRipple),frozen:l(e.Flags,c.SetFreeze,c.ClearFreeze),authorized:l(e.Flags,c.SetAuth,0)})}},"../../node_modules/ripple-lib/dist/npm/ledger/parse/utils.js":function(e,t,r){"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isPartialPayment=t.adjustQualityForXRP=t.parseTimestamp=t.hexToString=t.parseMemos=t.parseOutcome=t.parseQuality=void 0;const a=s(r("../../node_modules/ripple-lib-transactionparser/src/index.js")),u=s(r("../../node_modules/bignumber.js/bignumber.js")),c=o(r("../../node_modules/ripple-lib/dist/npm/common/index.js")),l=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/amount.js"));function d(e){if("number"==typeof e)return c.rippleTimeToISO8601(e)}function h(e){""===e.counterparty&&delete e.counterparty}function f(e){return 0!=(e.Flags&c.txFlags.Payment.PartialPayment)}function p(e){if("Payment"===e.TransactionType&&"tesSUCCESS"===e.meta.TransactionResult&&(!e.meta.delivered_amount||"unavailable"!==e.meta.delivered_amount))return e.meta.delivered_amount?l.default(e.meta.delivered_amount):e.meta.DeliveredAmount?l.default(e.meta.DeliveredAmount):e.Amount&&!f(e)||e.Amount&&e.ledger_index>4594094?l.default(e.Amount):void 0}function m(e){return e?Buffer.from(e,"hex").toString("utf-8"):void 0}t.adjustQualityForXRP=function(e,t,r){const n=("XRP"===r?-6:0)-("XRP"===t?-6:0);return 0===n?e:new u.default(e).shiftedBy(n).toString()},t.parseQuality=function(e){if("number"==typeof e)return new u.default(e).shiftedBy(-9).toNumber()},t.parseTimestamp=d,t.isPartialPayment=f,t.parseOutcome=function(e){const t=e.meta||e.metaData;if(!t)return;const r=a.default.parseBalanceChanges(t),n=a.default.parseOrderbookChanges(t),i=a.default.parseChannelChanges(t);return function(e){Object.entries(e).forEach((([e,t])=>{t.forEach(h)}))}(r),function(e){Object.entries(e).forEach((([e,t])=>{t.forEach((e=>{Object.entries(e).forEach(h)}))}))}(n),c.removeUndefined({result:e.meta.TransactionResult,timestamp:d(e.date),fee:c.dropsToXrp(e.Fee),balanceChanges:r,orderbookChanges:n,channelChanges:i,ledgerVersion:e.ledger_index,indexInLedger:e.meta.TransactionIndex,deliveredAmount:p(e)})},t.hexToString=m,t.parseMemos=function(e){if(Array.isArray(e.Memos)&&0!==e.Memos.length)return e.Memos.map((e=>c.removeUndefined({type:e.Memo.parsed_memo_type||m(e.Memo.MemoType),format:e.Memo.parsed_memo_format||m(e.Memo.MemoFormat),data:e.Memo.parsed_memo_data||m(e.Memo.MemoData)})))}},"../../node_modules/ripple-lib/dist/npm/ledger/pathfind.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=s(r("../../node_modules/lodash/lodash.js")),c=a(r("../../node_modules/bignumber.js/bignumber.js")),l=r("../../node_modules/ripple-lib/dist/npm/ledger/utils.js"),d=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),h=a(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/pathfind.js")),f=d.errors.NotFoundError,p=d.errors.ValidationError;function m(e,t){const r=Object.assign({value:"XRP"===t.destination.amount.currency?d.dropsToXrp("-1"):"-1"},t.destination.amount),n={command:"ripple_path_find",source_account:t.source.address,destination_account:t.destination.address,destination_amount:d.toRippledAmount(r)};if("object"!=typeof n.destination_amount||n.destination_amount.issuer||(n.destination_amount.issuer=n.destination_account),t.source.currencies&&t.source.currencies.length>0&&(n.source_currencies=t.source.currencies.map((e=>l.renameCounterpartyToIssuer(e)))),t.source.amount){if(null!=t.destination.amount.value)throw new p("Cannot specify both source.amount and destination.amount.value in getPaths");n.send_max=d.toRippledAmount(t.source.amount),"string"==typeof n.send_max||n.send_max.issuer||(n.send_max.issuer=t.source.address)}return e.request(n).then((e=>function(e,t){return u.defaults(Object.assign({},t,{source_account:e.source_account,source_currencies:e.source_currencies}),{destination_amount:e.destination_amount})}(n,e)))}function g(e,t,r){return"object"==typeof(i=r.destination_amount)&&i.currency&&"XRP"!==i.currency||!r.destination_currencies.includes("XRP")?n.resolve(r):l.getXRPBalance(e,t,void 0).then((e=>function(e,t){const r=e.destination_amount;return new c.default(t).isGreaterThanOrEqualTo(r)&&e.alternatives.unshift({paths_computed:[],source_amount:e.destination_amount}),e}(r,e)));var i}t.default=function(e){d.validate.getPaths({pathfind:e});const t=e.source.address;return m(this.connection,e).then((e=>g(this.connection,t,e))).then((t=>function(e,t){return e.source.amount&&null==e.destination.amount.value&&t.alternatives&&(t.alternatives=t.alternatives.filter((t=>{if(!t.source_amount)return!1;const r=new c.default("XRP"===e.source.amount.currency?d.xrpToDrops(e.source.amount.value):e.source.amount.value);return new c.default("string"==typeof t.source_amount?t.source_amount:t.source_amount.value).eq(r)}))),t}(e,t))).then((t=>function(e,t){if(t.alternatives&&t.alternatives.length>0)return h.default(t);throw null==t.destination_currencies||t.destination_currencies.includes(e.destination.amount.currency)?t.source_currencies&&t.source_currencies.length>0?new f("No paths found. Please ensure that the source_account has sufficient funds to execute the payment in one of the specified source_currencies. If it does there may be insufficient liquidity in the network to execute this payment right now"):new f("No paths found. Please ensure that the source_account has sufficient funds to execute the payment. If it does there may be insufficient liquidity in the network to execute this payment right now"):new f("No paths found. The destination_account does not accept "+e.destination.amount.currency+", they only accept: "+t.destination_currencies.join(", "))}(e,t)))}},"../../node_modules/ripple-lib/dist/npm/ledger/payment-channel.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const o=r("../../node_modules/ripple-lib/dist/npm/ledger/parse/payment-channel.js"),s=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),a=s.errors.NotFoundError;t.default=function(e){return i(this,void 0,void 0,(function*(){s.validate.getPaymentChannel({id:e});return function(e){if(null==e.node||"PayChannel"!==e.node.LedgerEntryType)throw new a("Payment channel ledger entry not found");return o.parsePaymentChannel(e.node)}(yield this.request("ledger_entry",{index:e,binary:!1,ledger_index:"validated"}))}))}},"../../node_modules/ripple-lib/dist/npm/ledger/settings.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getSettings=t.parseAccountFlags=void 0;const s=o(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/fields.js")),a=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),u=a.constants.AccountFlags;function c(e,t={}){const r={};for(const n in u)e&u[n]?r[n]=!0:t.excludeFalse||(r[n]=!1);return r}t.parseAccountFlags=c,t.getSettings=function(e,t={}){return i(this,void 0,void 0,(function*(){a.validate.getSettings({address:e,options:t}),e=a.ensureClassicAddress(e);return function(e){const t=e.account_data,r=c(t.Flags,{excludeFalse:!0}),n=s.default(t);return Object.assign({},r,n)}(yield this.request("account_info",{account:e,ledger_index:t.ledgerVersion||"validated",signer_lists:!0}))}))}},"../../node_modules/ripple-lib/dist/npm/ledger/transaction.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const c=s(r("../../node_modules/ripple-lib/dist/npm/ledger/utils.js")),l=u(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/transaction.js")),d=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t={}){return a(this,void 0,void 0,(function*(){d.validate.getTransaction({id:e,options:t});const r=yield c.ensureLedgerVersion.call(this,t);try{const t=yield this.request("tx",{transaction:e,binary:!1}),i=yield function(e,t){if(t.date)return n.resolve(t);const r=t.ledger_index||t.LedgerSequence;if(!r)return new n((()=>{const e=new d.errors.NotFoundError("Transaction has not been validated yet; try again later");throw e.data={details:"(ledger_index and LedgerSequence not found in tx)"},e}));const i={command:"ledger",ledger_index:r};return e.request(i).then((e=>{if("number"==typeof e.ledger.close_time)return Object.assign({date:e.ledger.close_time},t);throw new d.errors.UnexpectedError("Ledger missing close_time")})).catch((e=>{if(e instanceof d.errors.UnexpectedError)throw e;throw new d.errors.NotFoundError("Transaction ledger not found")}))}(this.connection,t);return function(e,t){if(!0!==t.validated||!function(e,t){return(!t.minLedgerVersion||e.ledger_index>=t.minLedgerVersion)&&(!t.maxLedgerVersion||e.ledger_index<=t.maxLedgerVersion)}(t,e))throw new d.errors.NotFoundError("Transaction not found");return l.default(t,e.includeRawTransaction)}(r,i)}catch(e){throw yield function(e,t,r){let i=!1;(r.data&&"txnNotFound"===r.data.error||"txnNotFound"===r.message)&&(i=!0);const o=i?new d.errors.NotFoundError("Transaction not found"):r;return o instanceof d.errors.NotFoundError?c.hasCompleteLedgerRange(e,t.minLedgerVersion,t.maxLedgerVersion).then((r=>r?o:c.isPendingLedgerVersion(e,t.maxLedgerVersion).then((e=>e?new d.errors.PendingLedgerVersionError:new d.errors.MissingLedgerHistoryError)))):n.resolve(o)}(this.connection,r,e)}}))}},"../../node_modules/ripple-lib/dist/npm/ledger/transactions.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/lodash/lodash.js")),u=s(r("../../node_modules/ripple-binary-codec/dist/index.js")),c=r("../../node_modules/ripple-lib/dist/npm/common/hashes/index.js"),l=o(r("../../node_modules/ripple-lib/dist/npm/ledger/utils.js")),d=s(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/transaction.js")),h=s(r("../../node_modules/ripple-lib/dist/npm/ledger/transaction.js")),f=r("../../node_modules/ripple-lib/dist/npm/common/index.js");function p(e,t){const r=e.tx_blob?function(e){const t=u.default.decode(e.tx_blob);return t.hash=c.computeTransactionHash(t),t.ledger_index=e.ledger_index,{tx:t,meta:u.default.decode(e.meta),validated:e.validated}}(e):e;return d.default(Object.assign({},r.tx,{meta:r.meta,validated:r.validated}),t)}function m(e,t,r){return(!t.excludeFailures||"tesSUCCESS"===r.outcome.result)&&(!(t.types&&!t.types.includes(r.type))&&((!0!==t.initiated||r.address===e)&&((!1!==t.initiated||r.address!==e)&&!(t.counterparty&&!function(e,t){if(t.address===e.counterparty)return!0;const r=t.specification;return!(!r||!(r.destination&&r.destination.address===e.counterparty||r.counterparty===e.counterparty))}(t,r)))))}function g(e,t){return!e.startTx||(e.earliestFirst?l.compareTransactions(t,e.startTx)>0:l.compareTransactions(t,e.startTx)<0)}function y(e,t,r,n,i){const o={command:"account_tx",account:t,ledger_index_min:r.minLedgerVersion||-1,ledger_index_max:r.maxLedgerVersion||-1,forward:r.earliestFirst,binary:r.binary,limit:l.clamp(i,10,400),marker:n};return e.request(o).then((e=>function(e,t,r){return{marker:r.marker,results:r.transactions.filter((e=>e.validated)).map((e=>p(e,t.includeRawTransactions))).filter(a.partial(m,e,t)).filter(a.partial(g,t))}}(t,r,e)))}function b(e,t,r){const n=t.earliestFirst?r.sort(l.compareTransactions):r.sort(l.compareTransactions).reverse();return function(e,t,r){let{minLedgerVersion:n,maxLedgerVersion:i}=t;return t.limit&&r.length===t.limit&&(t.earliestFirst?i=r[r.length-1].outcome.ledgerVersion:n=r[r.length-1].outcome.ledgerVersion),l.hasCompleteLedgerRange(e,n,i).then((e=>{if(!e)throw new f.errors.MissingLedgerHistoryError}))}(e,t,n).then((()=>n))}function v(e,t,r){const n=a.partial(y,e,t,r),i=a.partial(b,e,r);return l.getRecursive(n,r.limit).then(i)}t.default=function(e,t={}){f.validate.getTransactions({address:e,options:t}),e=f.ensureClassicAddress(e);const r={maxLedgerVersion:-1};if(t.start)return h.default.call(this,t.start).then((n=>{const i=n.outcome.ledgerVersion,o=t.earliestFirst?{minLedgerVersion:i}:{maxLedgerVersion:i},s=Object.assign({},r,t,{startTx:n},o);return v(this.connection,e,s)}));const n=Object.assign({},r,t);return v(this.connection,e,n)}},"../../node_modules/ripple-lib/dist/npm/ledger/trustlines.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const c=s(r("../../node_modules/lodash/lodash.js")),l=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),d=u(r("../../node_modules/ripple-lib/dist/npm/ledger/parse/account-trustline.js"));t.default=function(e,t={}){var r;return a(this,void 0,void 0,(function*(){l.validate.getTrustlines({address:e,options:t}),e=l.ensureClassicAddress(e);const n=yield this._requestAll("account_lines",{account:e,ledger_index:null!==(r=t.ledgerVersion)&&void 0!==r?r:yield this.getLedgerVersion(),limit:t.limit,peer:t.counterparty});return c.flatMap(n,(e=>e.lines)).map(d.default).filter((e=>function(e,t){return null===e||t.specification.currency===e}(t.currency||null,e)))}))}},"../../node_modules/ripple-lib/dist/npm/ledger/utils.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.common=t.clamp=t.isPendingLedgerVersion=t.hasCompleteLedgerRange=t.getRecursive=t.renameCounterpartyToIssuerInOrder=t.renameCounterpartyToIssuer=t.compareTransactions=t.ensureLedgerVersion=t.getXRPBalance=void 0;const a=s(r("../../node_modules/lodash/lodash.js")),u=s(r("../../node_modules/assert/build/assert.js")),c=s(r("../../node_modules/ripple-lib/dist/npm/common/index.js"));function l(e,t,r){return e(t,r).then((t=>{const n=r-t.results.length;return n>0&&null!=t.marker?l(e,t.marker,n).then((e=>t.results.concat(e))):t.results.slice(0,r)}))}function d(e){const t=null!=e.counterparty?e.counterparty:null!=e.issuer?e.issuer:void 0,r=Object.assign({},e,{issuer:t});return delete r.counterparty,r}t.common=c,t.clamp=function(e,t,r){return u.ok(t<=r,"Illegal clamp bounds"),Math.min(Math.max(e,t),r)},t.getXRPBalance=function(e,t,r){const n={command:"account_info",account:t,ledger_index:r};return e.request(n).then((e=>c.dropsToXrp(e.account_data.Balance)))},t.getRecursive=function(e,t){return l(e,void 0,t||1/0)},t.renameCounterpartyToIssuer=d,t.renameCounterpartyToIssuerInOrder=function(e){const t={taker_gets:d(e.taker_gets),taker_pays:d(e.taker_pays)};return Object.assign({},e,a.omitBy(t,(e=>null==e)))},t.compareTransactions=function(e,t){return e.outcome&&t.outcome?e.outcome.ledgerVersion===t.outcome.ledgerVersion?0===(r=e.outcome.indexInLedger-t.outcome.indexInLedger)?0:r>0?1:-1:e.outcome.ledgerVersione<(t||0)))},t.ensureLedgerVersion=function(e){return Boolean(e)&&null!=e.ledgerVersion&&null!==e.ledgerVersion?n.resolve(e):this.getLedgerVersion().then((t=>Object.assign({},e,{ledgerVersion:t})))}},"../../node_modules/ripple-lib/dist/npm/offline/derive.js":(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deriveXAddress=t.deriveAddress=t.deriveKeypair=void 0;const n=r("../../node_modules/ripple-keypairs/dist/index.js");Object.defineProperty(t,"deriveKeypair",{enumerable:!0,get:function(){return n.deriveKeypair}}),Object.defineProperty(t,"deriveAddress",{enumerable:!0,get:function(){return n.deriveAddress}});const i=r("../../node_modules/ripple-address-codec/dist/index.js");t.deriveXAddress=function(e){const t=n.deriveAddress(e.publicKey);return i.classicAddressToXAddress(t,e.tag,e.test)}},"../../node_modules/ripple-lib/dist/npm/offline/generate-address.js":function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.generateAddressAPI=void 0;const i=r("../../node_modules/ripple-address-codec/dist/index.js"),o=n(r("../../node_modules/ripple-keypairs/dist/index.js")),s=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.generateAddressAPI=function(e={}){s.validate.generateAddress({options:e});try{const t={algorithm:e.algorithm};e.entropy&&(t.entropy=Uint8Array.from(e.entropy));const r=o.default.generateSeed(t),n=o.default.deriveKeypair(r),s=o.default.deriveAddress(n.publicKey),a={xAddress:i.classicAddressToXAddress(s,!1,e&&e.test),secret:r};return e.includeClassicAddress&&(a.classicAddress=s,a.address=s),a}catch(e){throw new s.errors.UnexpectedError(e.message)}}},"../../node_modules/ripple-lib/dist/npm/offline/ledgerhash.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/lodash/lodash.js")),a=r("../../node_modules/ripple-lib/dist/npm/common/hashes/index.js"),u=o(r("../../node_modules/ripple-lib/dist/npm/common/index.js"));function c(e){const t=function(e){return{account_hash:e.stateHash,close_time:u.iso8601ToRippleTime(e.closeTime),close_time_resolution:e.closeTimeResolution,close_flags:e.closeFlags,hash:e.ledgerHash,ledger_hash:e.ledgerHash,ledger_index:e.ledgerVersion.toString(),parent_hash:e.parentLedgerHash,parent_close_time:u.iso8601ToRippleTime(e.parentCloseTime),total_coins:e.totalDrops,transaction_hash:e.transactionHash}}(e);return a.computeLedgerHash(t)}function l(e,t){let r;if(e.rawTransactions)r=JSON.parse(e.rawTransactions);else{if(!e.transactions){if(t.computeTreeHashes)throw new u.errors.ValidationError("transactions property is missing from the ledger");return e.transactionHash}try{r=e.transactions.map((e=>JSON.parse(e.rawTransaction)))}catch(e){if("SyntaxError: Unexpected token u in JSON at position 0"===e.toString())throw new u.errors.ValidationError("ledger is missing raw transactions")}}const n=r.map((e=>{const t=Object.assign({},s.omit(e,"tx"),e.tx||{});return Object.assign({},s.omit(t,"meta"),e.meta?{metaData:e.meta}:{})})),i=a.computeTransactionTreeHash(n);if(null!=e.transactionHash&&e.transactionHash!==i)throw new u.errors.ValidationError("transactionHash in header does not match computed hash of transactions",{transactionHashInHeader:e.transactionHash,computedHashOfTransactions:i});return i}function d(e,t){if(null==e.rawState){if(t.computeTreeHashes)throw new u.errors.ValidationError("rawState property is missing from the ledger");return e.stateHash}const r=JSON.parse(e.rawState),n=a.computeStateTreeHash(r);if(null!=e.stateHash&&e.stateHash!==n)throw new u.errors.ValidationError("stateHash in header does not match computed hash of state");return n}t.default=function(e,t={}){const r={transactionHash:l(e,t),stateHash:d(e,t)};return c(Object.assign({},e,r))}},"../../node_modules/ripple-lib/dist/npm/offline/sign-payment-channel-claim.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/ripple-lib/dist/npm/common/index.js")),u=s(r("../../node_modules/ripple-keypairs/dist/index.js")),c=s(r("../../node_modules/ripple-binary-codec/dist/index.js")),{validate:l,xrpToDrops:d}=a;t.default=function(e,t,r){l.signPaymentChannelClaim({channel:e,amount:t,privateKey:r});const n=c.default.encodeForSigningClaim({channel:e,amount:d(t)});return u.default.sign(n,r)}},"../../node_modules/ripple-lib/dist/npm/offline/utils.js":function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.verifyPaymentChannelClaim=t.signPaymentChannelClaim=t.deriveXAddress=t.deriveAddress=t.deriveKeypair=t.generateXAddress=t.generateAddress=t.computePaymentChannelHash=t.computeEscrowHash=t.computeLedgerHash=t.computeStateTreeHash=t.computeTransactionTreeHash=t.computeTrustlineHash=t.computeOrderID=t.computeSignerListLedgerObjectID=t.computeAccountLedgerObjectID=t.computeBinaryTransactionSigningHash=t.computeTransactionHash=t.computeBinaryTransactionHash=t.isValidSecret=t.iso8601ToRippleTime=t.rippleTimeToISO8601=t.removeUndefined=t.convertKeysFromSnakeCaseToCamelCase=t.toRippledAmount=t.xrpToDrops=t.dropsToXrp=t.computeLedgerHeaderHash=void 0;const i=r("../../node_modules/ripple-lib/dist/npm/offline/derive.js");Object.defineProperty(t,"deriveKeypair",{enumerable:!0,get:function(){return i.deriveKeypair}}),Object.defineProperty(t,"deriveAddress",{enumerable:!0,get:function(){return i.deriveAddress}}),Object.defineProperty(t,"deriveXAddress",{enumerable:!0,get:function(){return i.deriveXAddress}});const o=n(r("../../node_modules/ripple-lib/dist/npm/offline/ledgerhash.js"));t.computeLedgerHeaderHash=o.default;const s=n(r("../../node_modules/ripple-lib/dist/npm/offline/sign-payment-channel-claim.js"));t.signPaymentChannelClaim=s.default;const a=n(r("../../node_modules/ripple-lib/dist/npm/offline/verify-payment-channel-claim.js"));t.verifyPaymentChannelClaim=a.default;const u=r("../../node_modules/ripple-lib/dist/npm/common/utils.js");Object.defineProperty(t,"dropsToXrp",{enumerable:!0,get:function(){return u.dropsToXrp}}),Object.defineProperty(t,"xrpToDrops",{enumerable:!0,get:function(){return u.xrpToDrops}}),Object.defineProperty(t,"toRippledAmount",{enumerable:!0,get:function(){return u.toRippledAmount}}),Object.defineProperty(t,"convertKeysFromSnakeCaseToCamelCase",{enumerable:!0,get:function(){return u.convertKeysFromSnakeCaseToCamelCase}}),Object.defineProperty(t,"removeUndefined",{enumerable:!0,get:function(){return u.removeUndefined}}),Object.defineProperty(t,"rippleTimeToISO8601",{enumerable:!0,get:function(){return u.rippleTimeToISO8601}}),Object.defineProperty(t,"iso8601ToRippleTime",{enumerable:!0,get:function(){return u.iso8601ToRippleTime}}),Object.defineProperty(t,"isValidSecret",{enumerable:!0,get:function(){return u.isValidSecret}});const c=r("../../node_modules/ripple-lib/dist/npm/common/hashes/index.js");Object.defineProperty(t,"computeBinaryTransactionHash",{enumerable:!0,get:function(){return c.computeBinaryTransactionHash}}),Object.defineProperty(t,"computeTransactionHash",{enumerable:!0,get:function(){return c.computeTransactionHash}}),Object.defineProperty(t,"computeBinaryTransactionSigningHash",{enumerable:!0,get:function(){return c.computeBinaryTransactionSigningHash}}),Object.defineProperty(t,"computeAccountLedgerObjectID",{enumerable:!0,get:function(){return c.computeAccountLedgerObjectID}}),Object.defineProperty(t,"computeSignerListLedgerObjectID",{enumerable:!0,get:function(){return c.computeSignerListLedgerObjectID}}),Object.defineProperty(t,"computeOrderID",{enumerable:!0,get:function(){return c.computeOrderID}}),Object.defineProperty(t,"computeTrustlineHash",{enumerable:!0,get:function(){return c.computeTrustlineHash}}),Object.defineProperty(t,"computeTransactionTreeHash",{enumerable:!0,get:function(){return c.computeTransactionTreeHash}}),Object.defineProperty(t,"computeStateTreeHash",{enumerable:!0,get:function(){return c.computeStateTreeHash}}),Object.defineProperty(t,"computeLedgerHash",{enumerable:!0,get:function(){return c.computeLedgerHash}}),Object.defineProperty(t,"computeEscrowHash",{enumerable:!0,get:function(){return c.computeEscrowHash}}),Object.defineProperty(t,"computePaymentChannelHash",{enumerable:!0,get:function(){return c.computePaymentChannelHash}});const l=r("../../node_modules/ripple-lib/dist/npm/offline/generate-address.js");Object.defineProperty(t,"generateXAddress",{enumerable:!0,get:function(){return l.generateAddressAPI}});t.generateAddress=(e={})=>l.generateAddressAPI(Object.assign(Object.assign({},e),{includeClassicAddress:!0}))},"../../node_modules/ripple-lib/dist/npm/offline/verify-payment-channel-claim.js":function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r("../../node_modules/ripple-keypairs/dist/index.js")),o=n(r("../../node_modules/ripple-binary-codec/dist/index.js")),s=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t,r,n){s.validate.verifyPaymentChannelClaim({channel:e,amount:t,signature:r,publicKey:n});const a=o.default.encodeForSigningClaim({channel:e,amount:s.xrpToDrops(t)});return i.default.verify(a,r,n)}},"../../node_modules/ripple-lib/dist/npm/server/server.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.formatLedgerClose=t.getLedgerVersion=t.isConnected=t.disconnect=t.connect=void 0;const u=s(r("../../node_modules/ripple-lib/dist/npm/common/index.js"));t.isConnected=function(){return this.connection.isConnected()},t.getLedgerVersion=function(){return this.connection.getLedgerVersion()},t.connect=function(){return a(this,void 0,void 0,(function*(){return this.connection.connect()}))},t.disconnect=function(){return a(this,void 0,void 0,(function*(){yield this.connection.disconnect()}))},t.formatLedgerClose=function(e){return{baseFeeXRP:u.dropsToXrp(e.fee_base),ledgerHash:e.ledger_hash,ledgerVersion:e.ledger_index,ledgerTimestamp:u.rippleTimeToISO8601(e.ledger_time),reserveBaseXRP:u.dropsToXrp(e.reserve_base),reserveIncrementXRP:u.dropsToXrp(e.reserve_inc),transactionCount:e.txn_count,validatedLedgerVersions:e.validated_ledgers}}},"../../node_modules/ripple-lib/dist/npm/transaction/check-cancel.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(t,"__esModule",{value:!0});const i=r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js"),o=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t,r={}){try{o.validate.prepareCheckCancel({address:e,checkCancel:t,instructions:r});const n={Account:e,TransactionType:"CheckCancel",CheckID:t.checkID};return i.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/check-cash.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),u=a.common.errors.ValidationError,c=a.common.toRippledAmount,l=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t,r={}){try{l.validate.prepareCheckCash({address:e,checkCash:t,instructions:r});const n=function(e,t){if(t.amount&&t.deliverMin)throw new u('"amount" and "deliverMin" properties on CheckCash are mutually exclusive');const r={Account:e,TransactionType:"CheckCash",CheckID:t.checkID};return null!=t.amount&&(r.Amount=c(t.amount)),null!=t.deliverMin&&(r.DeliverMin=c(t.deliverMin)),r}(e,t);return a.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/check-create.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),u=a.common.toRippledAmount,c=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t,r={}){try{c.validate.prepareCheckCreate({address:e,checkCreate:t,instructions:r});const n=function(e,t){const r={Account:e,TransactionType:"CheckCreate",Destination:t.destination,SendMax:u(t.sendMax)};return null!=t.destinationTag&&(r.DestinationTag=t.destinationTag),null!=t.expiration&&(r.Expiration=c.iso8601ToRippleTime(t.expiration)),null!=t.invoiceID&&(r.InvoiceID=t.invoiceID),r}(e,t);return a.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/combine.js":function(e,t,r){"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r("../../node_modules/lodash/lodash.js")),u=s(r("../../node_modules/ripple-binary-codec/dist/index.js")),c=s(r("../../node_modules/bignumber.js/bignumber.js")),l=r("../../node_modules/ripple-lib/dist/npm/common/errors.js"),d=r("../../node_modules/ripple-address-codec/dist/index.js"),h=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),f=r("../../node_modules/ripple-lib/dist/npm/common/hashes/index.js");function p(e){const t=Buffer.from(d.decodeAccountID(e)).toString("hex");return new c.default(t,16)}function m(e,t){return p(e.Signer.Account).comparedTo(p(t.Signer.Account))}t.default=function(e){h.validate.combine({signedTransactions:e});const t=e.map(u.default.decode);!function(e){const t=JSON.stringify(Object.assign(Object.assign({},e[0]),{Signers:null}));if(e.slice(1).some((e=>JSON.stringify(Object.assign(Object.assign({},e),{Signers:null}))!==t)))throw new l.ValidationError("txJSON is not the same for all signedTransactions")}(t);const r=u.default.encode(function(e){const t=a.flatMap(e,(e=>e.Signers)).filter((e=>e)).sort(m);return Object.assign(Object.assign({},e[0]),{Signers:t})}(t));return{signedTransaction:r,id:f.computeBinaryTransactionHash(r)}}},"../../node_modules/ripple-lib/dist/npm/transaction/escrow-cancellation.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),a=s.common.validate;t.default=function(e,t,r={}){a.prepareEscrowCancellation({address:e,escrowCancellation:t,instructions:r});const n=function(e,t){const r={TransactionType:"EscrowCancel",Account:e,Owner:t.owner,OfferSequence:t.escrowSequence};return null!=t.memos&&(r.Memos=t.memos.map(s.convertMemo)),r}(e,t);return s.prepareTransaction(n,this,r)}},"../../node_modules/ripple-lib/dist/npm/transaction/escrow-creation.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),u=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),c=a.common.errors.ValidationError;t.default=function(e,t,r={}){try{u.validate.prepareEscrowCreation({address:e,escrowCreation:t,instructions:r});const n=function(e,t){const r={TransactionType:"EscrowCreate",Account:e,Destination:t.destination,Amount:u.xrpToDrops(t.amount)};if(null!=t.condition&&(r.Condition=t.condition),null!=t.allowCancelAfter&&(r.CancelAfter=u.iso8601ToRippleTime(t.allowCancelAfter)),null!=t.allowExecuteAfter&&(r.FinishAfter=u.iso8601ToRippleTime(t.allowExecuteAfter)),null!=t.sourceTag&&(r.SourceTag=t.sourceTag),null!=t.destinationTag&&(r.DestinationTag=t.destinationTag),null!=t.memos&&(r.Memos=t.memos.map(a.convertMemo)),Boolean(t.allowCancelAfter)&&Boolean(t.allowExecuteAfter)&&r.CancelAfter<=r.FinishAfter)throw new c('prepareEscrowCreation: "allowCancelAfter" must be after "allowExecuteAfter"');return r}(e,t);return a.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/escrow-execution.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),u=a.common.validate,c=a.common.errors.ValidationError;t.default=function(e,t,r={}){try{u.prepareEscrowExecution({address:e,escrowExecution:t,instructions:r});const n=function(e,t){const r={TransactionType:"EscrowFinish",Account:e,Owner:t.owner,OfferSequence:t.escrowSequence};if(Boolean(t.condition)!==Boolean(t.fulfillment))throw new c('"condition" and "fulfillment" fields on EscrowFinish must only be specified together.');return null!=t.condition&&(r.Condition=t.condition),null!=t.fulfillment&&(r.Fulfillment=t.fulfillment),null!=t.memos&&(r.Memos=t.memos.map(a.convertMemo)),r}(e,t);return a.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/order.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),u=a.common.txFlags.OfferCreate,c=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t,r={}){try{c.validate.prepareOrder({address:e,order:t,instructions:r});const n=function(e,t){const r=c.toRippledAmount("buy"===t.direction?t.quantity:t.totalPrice),n={TransactionType:"OfferCreate",Account:e,TakerGets:c.toRippledAmount("buy"===t.direction?t.totalPrice:t.quantity),TakerPays:r,Flags:0};return"sell"===t.direction&&(n.Flags|=u.Sell),!0===t.passive&&(n.Flags|=u.Passive),!0===t.immediateOrCancel&&(n.Flags|=u.ImmediateOrCancel),!0===t.fillOrKill&&(n.Flags|=u.FillOrKill),null!=t.expirationTime&&(n.Expiration=c.iso8601ToRippleTime(t.expirationTime)),null!=t.orderToReplace&&(n.OfferSequence=t.orderToReplace),null!=t.memos&&(n.Memos=t.memos.map(a.convertMemo)),n}(e,t);return a.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/ordercancellation.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),u=a.common.validate;t.default=function(e,t,r={}){try{u.prepareOrderCancellation({address:e,orderCancellation:t,instructions:r});const n=function(e,t){const r={TransactionType:"OfferCancel",Account:e,OfferSequence:t.orderSequence};return null!=t.memos&&(r.Memos=t.memos.map(a.convertMemo)),r}(e,t);return a.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/payment-channel-claim.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),u=a.common.errors.ValidationError,c=a.common.txFlags.PaymentChannelClaim,l=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t,r={}){try{l.validate.preparePaymentChannelClaim({address:e,paymentChannelClaim:t,instructions:r});const n=function(e,t){const r={Account:e,TransactionType:"PaymentChannelClaim",Channel:t.channel,Flags:0};if(null!=t.balance&&(r.Balance=l.xrpToDrops(t.balance)),null!=t.amount&&(r.Amount=l.xrpToDrops(t.amount)),Boolean(t.signature)!==Boolean(t.publicKey))throw new u('"signature" and "publicKey" fields on PaymentChannelClaim must only be specified together.');if(null!=t.signature&&(r.Signature=t.signature),null!=t.publicKey&&(r.PublicKey=t.publicKey),!0===t.renew&&!0===t.close)throw new u('"renew" and "close" flags on PaymentChannelClaim are mutually exclusive');return!0===t.renew&&(r.Flags|=c.Renew),!0===t.close&&(r.Flags|=c.Close),r}(e,t);return a.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/payment-channel-create.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),u=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t,r={}){try{u.validate.preparePaymentChannelCreate({address:e,paymentChannelCreate:t,instructions:r});const n=function(e,t){const r={Account:e,TransactionType:"PaymentChannelCreate",Amount:u.xrpToDrops(t.amount),Destination:t.destination,SettleDelay:t.settleDelay,PublicKey:t.publicKey.toUpperCase()};return null!=t.cancelAfter&&(r.CancelAfter=u.iso8601ToRippleTime(t.cancelAfter)),null!=t.sourceTag&&(r.SourceTag=t.sourceTag),null!=t.destinationTag&&(r.DestinationTag=t.destinationTag),r}(e,t);return a.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/payment-channel-fund.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),u=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t,r={}){try{u.validate.preparePaymentChannelFund({address:e,paymentChannelFund:t,instructions:r});const n=function(e,t){const r={Account:e,TransactionType:"PaymentChannelFund",Channel:t.channel,Amount:u.xrpToDrops(t.amount)};return null!=t.expiration&&(r.Expiration=u.iso8601ToRippleTime(t.expiration)),r}(e,t);return a.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/payment.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/lodash/lodash.js")),u=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),c=u.common.validate,l=u.common.txFlags.Payment,d=u.common.errors.ValidationError,h=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),f=r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js");function p(e){return null!=e.maxAmount}function m(e){return null!=e.minAmount}function g(e){const{source:t,destination:r}=e,n=p(t)?t.maxAmount.currency:t.amount.currency,i=m(r)?r.minAmount.currency:r.amount.currency;return!("XRP"!==n&&"drops"!==n||"XRP"!==i&&"drops"!==i)}function y(e,t){const r=f.getClassicAccountAndTag(e,t);return r.tag=!1===r.tag?void 0:r.tag,r}function b(e,t){const r=a.cloneDeep(t);!function(e){[e.source,e.destination].forEach((e=>{["amount","minAmount","maxAmount"].forEach((t=>{var r;(r=e[t])&&"XRP"!==r.currency&&"drops"!==r.currency&&null==r.counterparty&&(e[t].counterparty=e.address)}))}))}(r);const n=y(r.source.address,r.source.tag),i=y(e,void 0);if(i.classicAccount!==n.classicAccount)throw new d("address must match payment.source.address");if(null!=i.tag&&null!=n.tag&&i.tag!==n.tag)throw new d("address includes a tag that does not match payment.source.tag");const o=y(r.destination.address,r.destination.tag);if(p(r.source)&&m(r.destination)||!p(r.source)&&!m(r.destination))throw new d("payment must specify either (source.maxAmount and destination.amount) or (source.amount and destination.minAmount)");const s=m(r.destination)?r.destination.minAmount:r.destination.amount,c=p(r.source)?r.source.maxAmount:r.source.amount,f=m(r.destination)&&!g(r)?function(e){const t="100000000000";let r;return r="XRP"===e.currency?t:"drops"===e.currency?h.xrpToDrops(t):"999999999999999900000000000000000000000000000000000000000000000000000000000000000000000000000000",Object.assign({},e,{value:r})}(s):s,b={TransactionType:"Payment",Account:n.classicAccount,Destination:o.classicAccount,Amount:h.toRippledAmount(f),Flags:0};if(null!=r.invoiceID&&(b.InvoiceID=r.invoiceID),null!=n.tag&&(b.SourceTag=n.tag),null!=o.tag&&(b.DestinationTag=o.tag),null!=r.memos&&(b.Memos=r.memos.map(u.convertMemo)),!0===r.noDirectRipple&&(b.Flags|=l.NoRippleDirect),!0===r.limitQuality&&(b.Flags|=l.LimitQuality),g(r)){if(!0===r.allowPartialPayment)throw new d("XRP to XRP payments cannot be partial payments")}else(r.allowPartialPayment||m(r.destination))&&(b.Flags|=l.PartialPayment),b.SendMax=h.toRippledAmount(c),m(r.destination)&&(b.DeliverMin=h.toRippledAmount(s)),null!=r.paths&&(b.Paths=JSON.parse(r.paths));return b}t.default=function(e,t,r={}){try{c.preparePayment({address:e,payment:t,instructions:r});const n=b(e,t);return u.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/settings.js":function(e,t,r){"use strict";var Buffer=r("../../node_modules/buffer/index.js").Buffer,n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=s(r("../../node_modules/assert/build/assert.js")),c=a(r("../../node_modules/bignumber.js/bignumber.js")),l=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),d=l.common.validate,h=l.common.constants.AccountSetFlags,f=l.common.constants.AccountFields;function p(e){return{SignerEntry:{Account:e.address,SignerWeight:e.weight}}}function m(e,t){if(void 0!==t.regularKey){const r={TransactionType:"SetRegularKey",Account:e};return null===t.regularKey?r:Object.assign({},r,{RegularKey:t.regularKey})}if(null!=t.signers){const r={TransactionType:"SignerListSet",Account:e,SignerEntries:[],SignerQuorum:t.signers.threshold};return null!=t.signers.weights&&(r.SignerEntries=t.signers.weights.map(p)),r}const r={TransactionType:"AccountSet",Account:e},n=Object.assign({},t);var i;return delete n.memos,function(e,t){const r=Object.keys(t).filter((e=>null!=h[e]));u.ok(r.length<=1,"ERROR: can only set one setting per transaction");const n=r[0],i=t[n],o=h[n];null!=o&&(i?e.SetFlag=o:e.ClearFlag=o)}(r,n),function(e,t){const r=f;for(const n in r){const i=r[n];let o=t[i.name];void 0!==o&&(null===o&&i.hasOwnProperty("defaults")&&(o=i.defaults),"hex"!==i.encoding||i.length||(o=Buffer.from(o,"ascii").toString("hex").toUpperCase()),e[n]=o)}}(r,t),null!=r.TransferRate&&(r.TransferRate=(i=r.TransferRate,new c.default(i).shiftedBy(9).toNumber())),r}t.default=function(e,t,r={}){try{d.prepareSettings({address:e,settings:t,instructions:r});const n=function(e,t){const r=m(e,t);return null!=t.memos&&(r.Memos=t.memos.map(l.convertMemo)),r}(e,t);return l.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/sign.js":function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/lodash/lodash.js")),u=o(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),c=s(r("../../node_modules/ripple-keypairs/dist/index.js")),l=s(r("../../node_modules/ripple-binary-codec/dist/index.js")),d=r("../../node_modules/ripple-lib/dist/npm/common/hashes/index.js"),h=s(r("../../node_modules/bignumber.js/bignumber.js")),f=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),p=u.common.validate;function m(e,t,r){const n=r?l.default.encodeForMultisigning(e,r):l.default.encodeForSigning(e);return c.default.sign(n,t)}function g(e,t,r,n={signAs:""}){p.sign({txJSON:t,keypair:r});const i=JSON.parse(t);if(i.TxnSignature||i.Signers)throw new u.common.errors.ValidationError('txJSON must not contain "TxnSignature" or "Signers" properties');!function(e,t){const r=new h.default(t),n=f.xrpToDrops(e._maxFeeXRP);if(r.isGreaterThan(n))throw new u.common.errors.ValidationError(`"Fee" should not exceed "${n}". To use a higher fee, set \`maxFeeXRP\` in the RippleAPI constructor.`)}(e,i.Fee);const o=Object.assign({},i);if(o.SigningPubKey=n.signAs?"":r.publicKey,n.signAs){const e={Account:n.signAs,SigningPubKey:r.publicKey,TxnSignature:m(o,r.privateKey,n.signAs)};o.Signers=[{Signer:e}]}else o.TxnSignature=m(o,r.privateKey);const s=l.default.encode(o);return function(e,t){var r;const n=l.default.decode(e);if(!n.TxnSignature&&!n.Signers)throw new u.common.errors.ValidationError("Serialized transaction must have a TxnSignature or Signers property");delete n.TxnSignature,delete n.Signers,t.SigningPubKey||delete n.SigningPubKey;if(null===(r=t.Memos)||void 0===r||r.map((e=>{var t,r,n;return(null===(t=null==e?void 0:e.Memo)||void 0===t?void 0:t.MemoData)&&(e.Memo.MemoData=e.Memo.MemoData.toUpperCase()),(null===(r=null==e?void 0:e.Memo)||void 0===r?void 0:r.MemoType)&&(e.Memo.MemoType=e.Memo.MemoType.toUpperCase()),(null===(n=null==e?void 0:e.Memo)||void 0===n?void 0:n.MemoFormat)&&(e.Memo.MemoFormat=e.Memo.MemoFormat.toUpperCase()),e})),!a.default.isEqual(n,t)){const e=new u.common.errors.ValidationError("Serialized transaction does not match original txJSON. See `error.data`");throw e.data={decoded:n,tx:t,diff:y(t,n)},e}}(s,i),{signedTransaction:s,id:d.computeBinaryTransactionHash(s)}}function y(e,t){const r={},n=function(e,t,n){const i=Object.prototype.toString.call(e),o=Object.prototype.toString.call(t);if("[object Undefined]"!==o)if(i===o)if("[object Object]"!==i)"[object Array]"!==i?"[object Function]"!==i?e!==t&&(r[n]=t):e.toString()!==t.toString()&&(r[n]=t):a.default.isEqual(e,t)||(r[n]=t);else{const i=y(e,t);Object.keys(i).length>0&&(r[n]=i)}else r[n]=t;else r[n]=null};for(const r in e)e.hasOwnProperty(r)&&n(e[r],t[r],r);for(const n in t)t.hasOwnProperty(n)&&(e[n]||e[n]===t[n]||(r[n]=t[n]));return r}t.default=function(e,t,r,n){if("string"==typeof t)return p.sign({txJSON:e,secret:t}),g(this,e,c.default.deriveKeypair(t),r);if(!n&&!t)throw new u.common.errors.ValidationError("sign: Missing secret or keypair.");return g(this,e,n||t,r)}},"../../node_modules/ripple-lib/dist/npm/transaction/submit.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const u=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),c=r("../../node_modules/ripple-lib/dist/npm/common/index.js");t.default=function(e,t){return a(this,void 0,void 0,(function*(){c.validate.submit({signedTransaction:e});return function(e){const t={resultCode:e.engine_result,resultMessage:e.engine_result_message,engine_result:e.engine_result,engine_result_code:e.engine_result_code,engine_result_message:e.engine_result_message,tx_blob:e.tx_blob,tx_json:e.tx_json};if(e.engine_result.startsWith("tem"))throw new u.common.errors.RippledError("Submit failed",t);return t}(yield this.request("submit",Object.assign({tx_blob:e},t?{fail_hard:t}:{})))}))}},"../../node_modules/ripple-lib/dist/npm/transaction/ticket.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),u=a.common.validate,c=a.common.errors.ValidationError;t.default=function(e,t,r={}){try{u.prepareTicketCreate({address:e,ticketCount:t,instructions:r});const n=function(e,t){if(!t||0===t)throw new c("Ticket count must be greater than 0.");return{TransactionType:"TicketCreate",Account:e,TicketCount:t}}(e,t);return a.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/trustline.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=a(r("../../node_modules/bignumber.js/bignumber.js")),c=s(r("../../node_modules/ripple-lib/dist/npm/transaction/utils.js")),l=c.common.validate,d=c.common.txFlags.TrustSet;function h(e){return new u.default(e).shiftedBy(9).integerValue(u.default.ROUND_DOWN).toNumber()}t.default=function(e,t,r={}){try{l.prepareTrustline({address:e,trustline:t,instructions:r});const n=function(e,t){const r={TransactionType:"TrustSet",Account:e,LimitAmount:{currency:t.currency,issuer:t.counterparty,value:t.limit},Flags:0};return null!=t.qualityIn&&(r.QualityIn=h(t.qualityIn)),null!=t.qualityOut&&(r.QualityOut=h(t.qualityOut)),!0===t.authorized&&(r.Flags|=d.SetAuth),null!=t.ripplingDisabled&&(r.Flags|=t.ripplingDisabled?d.NoRipple:d.ClearNoRipple),null!=t.frozen&&(r.Flags|=t.frozen?d.SetFreeze:d.ClearFreeze),null!=t.memos&&(r.Memos=t.memos.map(c.convertMemo)),r}(e,t);return c.prepareTransaction(n,this,r)}catch(e){return n.reject(e)}}},"../../node_modules/ripple-lib/dist/npm/transaction/types.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"../../node_modules/ripple-lib/dist/npm/transaction/utils.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,Buffer=r("../../node_modules/buffer/index.js").Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getClassicAccountAndTag=t.setCanonicalFlag=t.common=t.prepareTransaction=t.convertMemo=t.convertStringToHex=void 0;const c=u(r("../../node_modules/bignumber.js/bignumber.js")),l=s(r("../../node_modules/ripple-lib/dist/npm/common/index.js"));t.common=l;const d=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),h=r("../../node_modules/ripple-lib/dist/npm/common/errors.js"),f=r("../../node_modules/ripple-address-codec/dist/index.js"),p=l.txFlags,m=["Payment","CheckCreate","EscrowCreate","PaymentChannelCreate"];function g(e){e.Flags|=p.Universal.FullyCanonicalSig,e.Flags=e.Flags>>>0}function y(e,t,r=0){return new c.default(e).times(t).plus(r).toString()}function b(e,t){if(f.isValidXAddress(e)){const r=f.xAddressToClassicAddress(e);if(null!=t&&r.tag!==t)throw new h.ValidationError("address includes a tag that does not match the tag specified in the transaction");return{classicAccount:r.classicAddress,tag:r.tag}}return{classicAccount:e,tag:t}}function v(e){return Buffer.from(e,"utf8").toString("hex").toUpperCase()}t.setCanonicalFlag=g,t.getClassicAccountAndTag=b,t.prepareTransaction=function(e,t,r){if(l.validate.instructions(r),l.validate.tx_json(e),null!=r.sequence&&0===r.sequence)return n.reject(new h.ValidationError("`sequence` cannot be 0"));const i=["maxLedgerVersion","maxLedgerVersionOffset","fee","sequence","ticketSequence"].filter((t=>e[t]));if(i.length)return n.reject(new h.ValidationError('txJSON additionalProperty "'+i[0]+'" exists in instance when not allowed'));const o=Object.assign({},e);0===e.SignerQuorum&&delete o.SignerEntries;const{classicAccount:s,tag:u}=b(e.Account);if(o.Account=s,null!=u){if(e.SourceTag&&e.SourceTag!==u)return n.reject(new h.ValidationError("The `SourceTag`, if present, must match the tag of the `Account` X-address"));u&&(o.SourceTag=u)}if("string"==typeof e.Destination){const{classicAccount:t,tag:r}=b(e.Destination);if(o.Destination=t,null!=r&&m.includes(e.TransactionType)){if(e.DestinationTag&&e.DestinationTag!==r)return n.reject(new h.ValidationError("The Payment `DestinationTag`, if present, must match the tag of the `Destination` X-address"));r&&(o.DestinationTag=r)}}function f(t){const r=e[t];if("string"==typeof r){const{classicAccount:e}=b(r);o[t]=e}}function p(t){const r=e[t];"number"==typeof r||r instanceof Array||null==r||(o[t]=d.toRippledAmount(r))}return f("Authorize"),f("Unauthorize"),f("Owner"),f("RegularKey"),p("Amount"),p("SendMax"),p("DeliverMin"),p("TakerPays"),p("TakerGets"),p("LimitAmount"),g(o),n.all([function(){if(o.LastLedgerSequence&&r.maxLedgerVersion)return n.reject(new h.ValidationError("`LastLedgerSequence` in txJSON and `maxLedgerVersion` in `instructions` cannot both be set"));if(o.LastLedgerSequence&&r.maxLedgerVersionOffset)return n.reject(new h.ValidationError("`LastLedgerSequence` in txJSON and `maxLedgerVersionOffset` in `instructions` cannot both be set"));if(o.LastLedgerSequence)return n.resolve();if(void 0!==r.maxLedgerVersion)return null!==r.maxLedgerVersion&&(o.LastLedgerSequence=r.maxLedgerVersion),n.resolve();const e=null!=r.maxLedgerVersionOffset?r.maxLedgerVersionOffset:3;return t.connection.getLedgerVersion().then((t=>{o.LastLedgerSequence=t+e}))}(),function(){if(o.Fee&&r.fee)return n.reject(new h.ValidationError("`Fee` in txJSON and `fee` in `instructions` cannot both be set"));if(o.Fee)return n.resolve();const e=null==r.signersCount?1:r.signersCount+1;if(null!=r.fee){const i=new c.default(r.fee);return i.isGreaterThan(t._maxFeeXRP)?n.reject(new h.ValidationError(`Fee of ${i.toString(10)} XRP exceeds max of ${t._maxFeeXRP} XRP. To use this fee, increase \`maxFeeXRP\` in the RippleAPI constructor.`)):(o.Fee=y(l.xrpToDrops(r.fee),e),n.resolve())}const i=t._feeCushion;return t.getFee(i).then((n=>t.connection.getFeeRef().then((s=>{const a="EscrowFinish"!==o.TransactionType||null==o.Fulfillment?0:i*s*(32+Math.floor(Buffer.from(o.Fulfillment,"hex").length/16)),u=l.xrpToDrops(n),d=r.maxFee?c.default.min(t._maxFeeXRP,r.maxFee):t._maxFeeXRP,h=l.xrpToDrops(d),f=y(u,e,a);o.Fee=c.default.min(f,h).toString(10)}))))}(),function(){return a(this,void 0,void 0,(function*(){if(null!=r.sequence)return null==o.Sequence||r.sequence===o.Sequence?(o.Sequence=r.sequence,n.resolve()):n.reject(new h.ValidationError("`Sequence` in txJSON must match `sequence` in `instructions`"));if(null!=o.Sequence)return n.resolve();if(null!=r.ticketSequence)return o.Sequence=0,o.TicketSequence=r.ticketSequence,n.resolve();try{const e=yield t.request("account_info",{account:s,ledger_index:"current"});return o.Sequence=e.account_data.Sequence,n.resolve()}catch(e){return n.reject(e)}}))}()]).then((()=>function(e){const t={fee:l.dropsToXrp(e.Fee),maxLedgerVersion:null==e.LastLedgerSequence?null:e.LastLedgerSequence};return null!=e.TicketSequence?t.ticketSequence=e.TicketSequence:t.sequence=e.Sequence,{txJSON:JSON.stringify(e),instructions:t}}(o)))},t.convertStringToHex=v,t.convertMemo=function(e){return{Memo:l.removeUndefined({MemoData:e.data?v(e.data):void 0,MemoType:e.type?v(e.type):void 0,MemoFormat:e.format?v(e.format):void 0})}}},"../../node_modules/ripple-lib/dist/npm/wallet/wallet-generation.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,Buffer=r("../../node_modules/buffer/index.js").Buffer,i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=n))((function(n,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.getFaucetUrl=t.FaucetNetwork=void 0;const o=r("?2ae8"),s=r("../../node_modules/ripple-lib/dist/npm/common/index.js"),a=r("../../node_modules/ripple-lib/dist/npm/common/schema-validator.js"),u=r("../../node_modules/ripple-lib/dist/npm/common/errors.js");var c;!function(e){e.Testnet="faucet.altnet.rippletest.net",e.Devnet="faucet.devnet.rippletest.net"}(c=t.FaucetNetwork||(t.FaucetNetwork={}));const l=1,d=20;function h(e,t){return i(this,void 0,void 0,(function*(){try{const r=yield e.getBalances(t);return r.filter((e=>"XRP"===e.currency.toUpperCase()))[0].value}catch(e){return`Unable to retrieve ${t} balance. Error: ${e}`}}))}function f(e){const t=e.connection.getUrl();return t.includes("altnet")||t.includes("testnet")?c.Testnet:t.includes("devnet")?c.Devnet:void 0}t.getFaucetUrl=f,t.default=function(e){return i(this,void 0,void 0,(function*(){if(!this.isConnected())throw new u.RippledError("RippleAPI not connected, cannot call faucet");let t,r=0,c=f(this);if(e&&a.isValidAddress(e)){t=(new TextEncoder).encode(JSON.stringify({destination:e}));const n=yield h(this,e);r=n&&!isNaN(+n)?+n:0}const p={hostname:c,port:443,path:"/accounts",method:"POST",headers:{"Content-Type":"application/json","Content-Length":t?t.length:0}};return new n(((e,a)=>{const u=o.request(p,(t=>{const o=[];t.on("data",(e=>{o.push(e)})),t.on("end",(()=>i(this,void 0,void 0,(function*(){const u=Buffer.concat(o).toString();if(t.headers["content-type"].startsWith("application/json")){const t=JSON.parse(u),o=t.account.classicAddress;if(o)try{const u=yield function(e,t,r){return i(this,void 0,void 0,(function*(){return new n(((n,o)=>{let a=d;const u=setInterval((()=>i(this,void 0,void 0,(function*(){a<0?(clearInterval(u),n(!1)):a--;try{+(yield h(e,t))>r&&(clearInterval(u),n(!0))}catch(e){clearInterval(u),o(new s.errors.XRPLFaucetError(`Unable to check if the address ${t} balance has increased. Error: ${e}`))}}))),1e3*l)}))}))}(this,o,r);u?e(t):a(new s.errors.XRPLFaucetError(`Unable to fund address with faucet after waiting ${l*d} seconds`))}catch(e){a(new s.errors.XRPLFaucetError(e))}else a(new s.errors.XRPLFaucetError("The faucet account classic address is undefined"))}else a({statusCode:t.statusCode,contentType:t.headers["content-type"],body:u})}))))}));u.write(t||""),u.on("error",(e=>{a(e)})),u.end()}))}))}},"../../node_modules/safe-buffer/index.js":(e,t,r)=>{ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +var n=r("../../node_modules/buffer/index.js"),Buffer=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return Buffer(e,t,r)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=o),o.prototype=Object.create(Buffer.prototype),i(Buffer,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return Buffer(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=Buffer(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Buffer(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},"../../node_modules/safer-buffer/safer.js":(e,t,r)=>{"use strict";var n,i=r("../../node_modules/process/browser.js"),o=r("../../node_modules/buffer/index.js"),Buffer=o.Buffer,s={};for(n in o)o.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(s[n]=o[n]);var a=s.Buffer={};for(n in Buffer)Buffer.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(a[n]=Buffer[n]);if(s.Buffer.prototype=Buffer.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return Buffer(e,t,r)}),a.alloc||(a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=Buffer(e);return t&&0!==t.length?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!s.kStringMaxLength)try{s.kStringMaxLength=i.binding("buffer").kStringMaxLength}catch(e){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),e.exports=s},"../../node_modules/sha.js/hash.js":(e,t,r)=>{var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer;function n(e,t){this._block=Buffer.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}n.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=Buffer.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},"../../node_modules/sha.js/index.js":(e,t,r)=>{var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r("../../node_modules/sha.js/sha.js"),n.sha1=r("../../node_modules/sha.js/sha1.js"),n.sha224=r("../../node_modules/sha.js/sha224.js"),n.sha256=r("../../node_modules/sha.js/sha256.js"),n.sha384=r("../../node_modules/sha.js/sha384.js"),n.sha512=r("../../node_modules/sha.js/sha512.js")},"../../node_modules/sha.js/sha.js":(e,t,r)=>{var n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,i.call(this,64,56)}function u(e){return e<<30|e>>>2}function c(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(a,i),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,s=0|this._c,a=0|this._d,l=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=r[d-3]^r[d-8]^r[d-14]^r[d-16];for(var h=0;h<80;++h){var f=~~(h/20),p=0|((t=n)<<5|t>>>27)+c(f,i,s,a)+l+r[h]+o[f];l=a,a=s,s=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=l+this._e|0},a.prototype._hash=function(){var e=Buffer.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=a},"../../node_modules/sha.js/sha1.js":(e,t,r)=>{var n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function a(){this.init(),this._w=s,i.call(this,64,56)}function u(e){return e<<5|e>>>27}function c(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(a,i),a.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},a.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,s=0|this._c,a=0|this._d,d=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=(t=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|t>>>31;for(var f=0;f<80;++f){var p=~~(f/20),m=u(n)+l(p,i,s,a)+d+r[f]+o[p]|0;d=a,a=s,s=c(i),i=n,n=m}this._a=n+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=d+this._e|0},a.prototype._hash=function(){var e=Buffer.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=a},"../../node_modules/sha.js/sha224.js":(e,t,r)=>{var n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/sha.js/sha256.js"),o=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=new Array(64);function a(){this.init(),this._w=s,o.call(this,64,56)}n(a,i),a.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},a.prototype._hash=function(){var e=Buffer.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=a},"../../node_modules/sha.js/sha256.js":(e,t,r)=>{var n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=[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],s=new Array(64);function a(){this.init(),this._w=s,i.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(a,i),a.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},a.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,s=0|this._c,a=0|this._d,f=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,y=0;y<16;++y)r[y]=e.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((t=r[y-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[y-7]+h(r[y-15])+r[y-16];for(var b=0;b<64;++b){var v=g+d(f)+u(f,p,m)+o[b]+r[b]|0,_=l(n)+c(n,i,s)|0;g=m,m=p,p=f,f=a+v|0,a=s,s=i,i=n,n=v+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=f+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},a.prototype._hash=function(){var e=Buffer.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=a},"../../node_modules/sha.js/sha384.js":(e,t,r)=>{var n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/sha.js/sha512.js"),o=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,s=new Array(160);function a(){this.init(),this._w=s,o.call(this,128,112)}n(a,i),a.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},a.prototype._hash=function(){var e=Buffer.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=a},"../../node_modules/sha.js/sha512.js":(e,t,r)=>{var n=r("../../node_modules/inherits/inherits_browser.js"),i=r("../../node_modules/sha.js/hash.js"),Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function a(){this.init(),this._w=s,i.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function p(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0>>0?1:0}n(a,i),a.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},a.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,s=0|this._dh,a=0|this._eh,y=0|this._fh,b=0|this._gh,v=0|this._hh,_=0|this._al,w=0|this._bl,M=0|this._cl,j=0|this._dl,S=0|this._el,A=0|this._fl,E=0|this._gl,x=0|this._hl,O=0;O<32;O+=2)t[O]=e.readInt32BE(4*O),t[O+1]=e.readInt32BE(4*O+4);for(;O<160;O+=2){var T=t[O-30],P=t[O-30+1],k=h(T,P),I=f(P,T),R=p(T=t[O-4],P=t[O-4+1]),N=m(P,T),C=t[O-14],B=t[O-14+1],L=t[O-32],F=t[O-32+1],D=I+B|0,q=k+C+g(D,I)|0;q=(q=q+R+g(D=D+N|0,N)|0)+L+g(D=D+F|0,F)|0,t[O]=q,t[O+1]=D}for(var U=0;U<160;U+=2){q=t[U],D=t[U+1];var z=c(r,n,i),V=c(_,w,M),$=l(r,_),H=l(_,r),K=d(a,S),X=d(S,a),Z=o[U],J=o[U+1],G=u(a,y,b),W=u(S,A,E),Y=x+X|0,Q=v+K+g(Y,x)|0;Q=(Q=(Q=Q+G+g(Y=Y+W|0,W)|0)+Z+g(Y=Y+J|0,J)|0)+q+g(Y=Y+D|0,D)|0;var ee=H+V|0,te=$+z+g(ee,H)|0;v=b,x=E,b=y,E=A,y=a,A=S,a=s+Q+g(S=j+Y|0,j)|0,s=i,j=M,i=n,M=w,n=r,w=_,r=Q+te+g(_=Y+ee|0,Y)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+M|0,this._dl=this._dl+j|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+E|0,this._hl=this._hl+x|0,this._ah=this._ah+r+g(this._al,_)|0,this._bh=this._bh+n+g(this._bl,w)|0,this._ch=this._ch+i+g(this._cl,M)|0,this._dh=this._dh+s+g(this._dl,j)|0,this._eh=this._eh+a+g(this._el,S)|0,this._fh=this._fh+y+g(this._fl,A)|0,this._gh=this._gh+b+g(this._gl,E)|0,this._hh=this._hh+v+g(this._hl,x)|0},a.prototype._hash=function(){var e=Buffer.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=a},"../../node_modules/stream-browserify/index.js":(e,t,r)=>{e.exports=i;var n=r("../../node_modules/events/events.js").EventEmitter;function i(){n.call(this)}r("../../node_modules/inherits/inherits_browser.js")(i,n),i.Readable=r("../../node_modules/readable-stream/lib/_stream_readable.js"),i.Writable=r("../../node_modules/readable-stream/lib/_stream_writable.js"),i.Duplex=r("../../node_modules/readable-stream/lib/_stream_duplex.js"),i.Transform=r("../../node_modules/readable-stream/lib/_stream_transform.js"),i.PassThrough=r("../../node_modules/readable-stream/lib/_stream_passthrough.js"),i.finished=r("../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js"),i.pipeline=r("../../node_modules/readable-stream/lib/internal/streams/pipeline.js"),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",c),e.on("error",c),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},"../../node_modules/string_decoder/lib/string_decoder.js":(e,t,r)=>{"use strict";var Buffer=r("../../node_modules/safe-buffer/index.js").Buffer,n=Buffer.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(Buffer.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=a,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=l,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function a(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(e.lastNeed=i-1),i;if(--n=0)return i>0&&(e.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},"../../node_modules/url/node_modules/punycode/punycode.js":function(e,t,r){var n;/*! https://mths.be/punycode v1.3.2 by @mathias */e=r.nmd(e),function(i){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var s,a=2147483647,u=36,c=1,l=26,d=38,h=700,f=72,p=128,m="-",g=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=u-c,w=Math.floor,M=String.fromCharCode;function j(e){throw RangeError(v[e])}function S(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function A(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+S((e=e.replace(b,".")).split("."),t).join(".")}function E(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=M((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=M(e)})).join("")}function O(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function T(e,t,r){var n=0;for(e=r?w(e/h):e>>1,e+=w(e/t);e>_*l>>1;n+=u)e=w(e/_);return w(n+(_+1)*e/(e+d))}function P(e){var t,r,n,i,o,s,d,h,g,y,b,v=[],_=e.length,M=0,S=p,A=f;for((r=e.lastIndexOf(m))<0&&(r=0),n=0;n=128&&j("not-basic"),v.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<_;){for(o=M,s=1,d=u;i>=_&&j("invalid-input"),((h=(b=e.charCodeAt(i++))-48<10?b-22:b-65<26?b-65:b-97<26?b-97:u)>=u||h>w((a-M)/s))&&j("overflow"),M+=h*s,!(h<(g=d<=A?c:d>=A+l?l:d-A));d+=u)s>w(a/(y=u-g))&&j("overflow"),s*=y;A=T(M-o,t=v.length+1,0==o),w(M/t)>a-S&&j("overflow"),S+=w(M/t),M%=t,v.splice(M++,0,S)}return x(v)}function k(e){var t,r,n,i,o,s,d,h,g,y,b,v,_,S,A,x=[];for(v=(e=E(e)).length,t=p,r=0,o=f,s=0;s=t&&bw((a-r)/(_=n+1))&&j("overflow"),r+=(d-t)*_,t=d,s=0;sa&&j("overflow"),b==t){for(h=r,g=u;!(h<(y=g<=o?c:g>=o+l?l:g-o));g+=u)A=h-y,S=u-y,x.push(M(O(y+A%S,0))),h=w(A/S);x.push(M(O(h,0))),o=T(r,_,n==i),r=0,++n}++r,++t}return x.join("")}s={version:"1.3.2",ucs2:{decode:E,encode:x},decode:P,encode:k,toASCII:function(e){return A(e,(function(e){return y.test(e)?"xn--"+k(e):e}))},toUnicode:function(e){return A(e,(function(e){return g.test(e)?P(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},"../../node_modules/url/url.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/url/node_modules/punycode/punycode.js"),i=r("../../node_modules/url/util.js");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=v(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),d=["%","/","?",";","#"].concat(l),h=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=r("../../node_modules/querystring/index.js");function v(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o127?R+="x":R+=I[N];if(!R.match(f)){var B=P.slice(0,x),L=P.slice(x+1),F=I.match(p);F&&(B.push(F[1]),L.unshift(F[2])),L.length&&(v="/"+L.join(".")+v),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=n.toASCII(this.hostname));var D=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+D,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!m[M])for(x=0,k=l.length;x0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!j.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=j.slice(-1)[0],E=(r.host||e.host||j.length>1)&&("."===A||".."===A)||""===A,x=0,O=j.length;O>=0;O--)"."===(A=j[O])?j.splice(O,1):".."===A?(j.splice(O,1),x++):x&&(j.splice(O,1),x--);if(!w&&!M)for(;x--;x)j.unshift("..");!w||""===j[0]||j[0]&&"/"===j[0].charAt(0)||j.unshift(""),E&&"/"!==j.join("/").substr(-1)&&j.push("");var T,P=""===j[0]||j[0]&&"/"===j[0].charAt(0);S&&(r.hostname=r.host=P?"":j.length?j.shift():"",(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift()));return(w=w||r.host&&j.length)&&!P&&j.unshift(""),j.length?r.pathname=j.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},"../../node_modules/url/util.js":e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},"../../node_modules/util-deprecate/browser.js":(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},"../../node_modules/util/support/isBufferBrowser.js":e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},"../../node_modules/util/support/types.js":(e,t,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=r("../../node_modules/is-arguments/index.js"),o=r("../../node_modules/is-generator-function/index.js"),s=r("../../node_modules/which-typed-array/index.js"),a=r("../../node_modules/is-typed-array/index.js");function u(e){return e.call.bind(e)}var c="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,d=u(Object.prototype.toString),h=u(Number.prototype.valueOf),f=u(String.prototype.valueOf),p=u(Boolean.prototype.valueOf);if(c)var m=u(BigInt.prototype.valueOf);if(l)var g=u(Symbol.prototype.valueOf);function y(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function b(e){return"[object Map]"===d(e)}function v(e){return"[object Set]"===d(e)}function _(e){return"[object WeakMap]"===d(e)}function w(e){return"[object WeakSet]"===d(e)}function M(e){return"[object ArrayBuffer]"===d(e)}function j(e){return"undefined"!=typeof ArrayBuffer&&(M.working?M(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===d(e)}function A(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=i,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return void 0!==n&&e instanceof n||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||A(e)},t.isUint8Array=function(e){return"Uint8Array"===s(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===s(e)},t.isUint16Array=function(e){return"Uint16Array"===s(e)},t.isUint32Array=function(e){return"Uint32Array"===s(e)},t.isInt8Array=function(e){return"Int8Array"===s(e)},t.isInt16Array=function(e){return"Int16Array"===s(e)},t.isInt32Array=function(e){return"Int32Array"===s(e)},t.isFloat32Array=function(e){return"Float32Array"===s(e)},t.isFloat64Array=function(e){return"Float64Array"===s(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===s(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===s(e)},b.working="undefined"!=typeof Map&&b(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(b.working?b(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},_.working="undefined"!=typeof WeakMap&&_(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(_.working?_(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},M.working="undefined"!=typeof ArrayBuffer&&M(new ArrayBuffer),t.isArrayBuffer=j,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=A;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(e){return"[object SharedArrayBuffer]"===d(e)}function O(e){return void 0!==E&&(void 0===x.working&&(x.working=x(new E)),x.working?x(e):e instanceof E)}function T(e){return y(e,h)}function P(e){return y(e,f)}function k(e){return y(e,p)}function I(e){return c&&y(e,m)}function R(e){return l&&y(e,g)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===d(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===d(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===d(e)},t.isGeneratorObject=function(e){return"[object Generator]"===d(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===d(e)},t.isNumberObject=T,t.isStringObject=P,t.isBooleanObject=k,t.isBigIntObject=I,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return T(e)||P(e)||k(e)||I(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(j(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},"../../node_modules/util/util.js":(e,t,r)=>{var n=r("../../node_modules/process/browser.js"),i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=d),f(n,e,n.depth)}function d(e,t){var r=l.styles[t];return r?"["+l.colors[r][0]+"m"+e+"["+l.colors[r][1]+"m":e}function h(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return _(i)||(i=f(e,i,n)),i}var o=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(_(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(y(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(E(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(M(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return e.stylize(Date.prototype.toString.call(r),"date");if(A(r))return p(r)}var c,l="",d=!1,h=["{","}"];(g(r)&&(d=!0,h=["[","]"]),E(r))&&(l=" [Function"+(r.name?": "+r.name:"")+"]");return M(r)&&(l=" "+RegExp.prototype.toString.call(r)),S(r)&&(l=" "+Date.prototype.toUTCString.call(r)),A(r)&&(l=" "+p(r)),0!==s.length||d&&0!=r.length?n<0?M(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=d?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,l,h)):h[0]+l+h[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function m(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),P(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=b(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function g(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function b(e){return null===e}function v(e){return"number"==typeof e}function _(e){return"string"==typeof e}function w(e){return void 0===e}function M(e){return j(e)&&"[object RegExp]"===x(e)}function j(e){return"object"==typeof e&&null!==e}function S(e){return j(e)&&"[object Date]"===x(e)}function A(e){return j(e)&&("[object Error]"===x(e)||e instanceof Error)}function E(e){return"function"==typeof e}function x(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(u.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r("../../node_modules/util/support/types.js"),t.isArray=g,t.isBoolean=y,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=_,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=M,t.types.isRegExp=M,t.isObject=j,t.isDate=S,t.types.isDate=S,t.isError=A,t.types.isNativeError=A,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r("../../node_modules/util/support/isBufferBrowser.js");var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[O(e.getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":"),[e.getDate(),T[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r("../../node_modules/inherits/inherits_browser.js"),t._extend=function(e,t){if(!t||!j(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(k&&e[k]){var t;if("function"!=typeof(t=e[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,k,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new i((function(e,n){t=e,r=n})),o=[],s=0;s{"use strict";var n=r("../../node_modules/for-each/index.js"),i=r("../../node_modules/available-typed-arrays/index.js"),o=r("../../node_modules/call-bind/callBound.js"),s=r("../../node_modules/gopd/index.js"),a=o("Object.prototype.toString"),u=r("../../node_modules/has-tostringtag/shams.js")(),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),d=o("String.prototype.slice"),h={},f=Object.getPrototypeOf;u&&s&&f&&n(l,(function(e){if("function"==typeof c[e]){var t=new c[e];if(Symbol.toStringTag in t){var r=f(t),n=s(r,Symbol.toStringTag);if(!n){var i=f(r);n=s(i,Symbol.toStringTag)}h[e]=n.get}}}));var p=r("../../node_modules/is-typed-array/index.js");e.exports=function(e){return!!p(e)&&(u&&Symbol.toStringTag in e?function(e){var t=!1;return n(h,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):d(a(e),8,-1))}},"../blockchain-link/lib/workers/ripple/index.js":function(e,t,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=r("../../node_modules/ripple-lib/dist/npm/index.js"),c=r("../../node_modules/ripple-lib/dist/npm/common/errors.js"),l=a(r("../../node_modules/bignumber.js/bignumber.js")),d=r("../blockchain-link-types/lib/constants/errors.js"),h=r("../blockchain-link-types/lib/constants/index.js"),f=r("../blockchain-link/lib/workers/baseWorker.js"),p=s(r("../blockchain-link-utils/lib/ripple.js")),m={BASE:"10000000",OWNER:"2000000"},g=({state:e,post:t},r)=>{if("transaction"!==r.type)return;const n=r.transaction;if("Payment"!==r.transaction.TransactionType)return;const i=e=>{t({id:-1,type:h.RESPONSES.NOTIFICATION,payload:{type:"notification",payload:{descriptor:e,tx:p.transformTransaction(e,Object.assign(Object.assign({},r),n))}}})},o=e.getAddresses(),s=o.find((e=>e===n.Account));s&&i(s);const a=o.find((e=>e===n.Destination));a&&i(a)},y=async e=>{if(!e.state.getSubscription("ledger")){(await e.connect()).on("ledger",(t=>(({post:e},t)=>{e({id:-1,type:h.RESPONSES.NOTIFICATION,payload:{type:"block",payload:{blockHeight:t.ledgerVersion,blockHash:t.ledgerHash}}})})(e,t))),e.state.addSubscription("ledger")}return{subscribed:!0}},b=async e=>{const{payload:t}=e;let r;if("accounts"===t.type)r=await(async(e,t)=>{const r=await e.connect(),{state:n}=e,i=n.getAddresses();n.addAccounts(t);const o=n.getAddresses().filter((e=>i.indexOf(e)<0));return o.length>0&&(n.getSubscription("notification")||(r.connection.on("transaction",(t=>g(e,t))),n.addSubscription("notification")),await r.request("subscribe",{accounts_proposed:o})),{subscribed:n.getAddresses().length>0}})(e,t.accounts);else if("addresses"===t.type)r=await(async(e,t)=>{const r=await e.connect(),{state:n}=e,i=n.addAddresses(t);if(i.length>0){n.getSubscription("transaction")||(r.connection.on("transaction",(t=>g(e,t))),n.addSubscription("transaction"));const t={accounts_proposed:i};await r.request("subscribe",t)}return{subscribed:n.getAddresses().length>0}})(e,t.addresses);else{if("block"!==t.type)throw new d.CustomError("invalid_param","+type");r=await y(e)}return{type:h.RESPONSES.SUBSCRIBE,payload:r}},v=async({state:e,connect:t},r)=>{const n=await t();if(r)e.removeAddresses(r),await n.request("unsubscribe",{accounts_proposed:r});else{const t=e.getAddresses();e.removeAccounts(e.getAccounts()),e.removeAddresses(t),await n.request("unsubscribe",{accounts_proposed:t})}e.getAccounts().length<1&&(n.connection.removeAllListeners("transaction"),e.removeSubscription("transaction"))},_=async e=>{const{payload:t}=e;return"accounts"===t.type?await(async(e,t)=>{const{state:r}=e,n=r.getAddresses();r.removeAccounts(t||r.getAccounts());const i=r.getAddresses(),o=n.filter((e=>i.indexOf(e)<0));await v(e,o)})(e,t.accounts):"addresses"===t.type?await v(e,t.addresses):"block"===t.type&&await(async({state:e,connect:t})=>{if(!e.getSubscription("ledger"))return;(await t()).removeAllListeners("ledger"),e.removeSubscription("ledger")})(e),{type:h.RESPONSES.UNSUBSCRIBE,payload:{subscribed:e.state.getAddresses().length>0}}},w=e=>{switch(e.type){case h.MESSAGES.GET_INFO:return(async e=>{const t=await e.connect(),r=await t.getServerInfo();return m.BASE=t.xrpToDrops(r.validatedLedger.reserveBaseXRP),m.OWNER=t.xrpToDrops(r.validatedLedger.reserveIncrementXRP),{type:h.RESPONSES.GET_INFO,payload:Object.assign({url:t.connection.getUrl()},p.transformServerInfo(r))}})(e);case h.MESSAGES.GET_ACCOUNT_INFO:return(async e=>{const{payload:t}=e,r={descriptor:t.descriptor,balance:"0",availableBalance:"0",empty:!0,history:{total:-1,unconfirmed:0,transactions:void 0},misc:{sequence:0,reserve:m.BASE}};try{const n=await e.connect(),i=await n.getAccountInfo(t.descriptor),o=i.ownerCount>0?new l.default(i.ownerCount).times(m.OWNER).toString():"0",s=new l.default(m.BASE).plus(o).toString(),a={sequence:i.sequence,reserve:s};r.misc=a,r.balance=n.xrpToDrops(i.xrpBalance),r.availableBalance=new l.default(r.balance).minus(s).toString(),r.empty=!1}catch(e){if(e instanceof c.RippleError&&e.data&&"actNotFound"===e.data.error)return{type:h.RESPONSES.GET_ACCOUNT_INFO,payload:r};throw e}try{const n=await e.connect(),i=await(async(e,t)=>{const r=await e.request("account_info",{account:t,ledger_index:"current",queue:!0});return{xrpBalance:r.account_data.Balance,sequence:r.account_data.Sequence,txs:r.queue_data?r.queue_data.txn_count:0}})(n,t.descriptor),{misc:o}=r,s=o&&"string"==typeof o.reserve?o.reserve:m.BASE;r.availableBalance=new l.default(i.xrpBalance).minus(s).toString(),r.misc.sequence=i.sequence,r.history.unconfirmed=i.txs}catch(e){}if("txs"!==t.details)return{type:h.RESPONSES.GET_ACCOUNT_INFO,payload:r};const n={account:t.descriptor,ledger_index_min:t.from?t.from:void 0,ledger_index_max:t.to?t.to:void 0,limit:t.pageSize||25,marker:t.marker},i=await e.connect(),o=await i.request("account_tx",n);return r.history.transactions=o.transactions.map((e=>p.transformTransaction(t.descriptor,e.tx))),{type:h.RESPONSES.GET_ACCOUNT_INFO,payload:Object.assign(Object.assign({},r),{marker:o.marker})}})(e);case h.MESSAGES.GET_TRANSACTION:return(async({connect:e,payload:t})=>{const r=await e(),n=await r.getTransaction(t);return{type:h.RESPONSES.GET_TRANSACTION,payload:{type:"ripple",tx:n}}})(e);case h.MESSAGES.ESTIMATE_FEE:return(async e=>{const t=await e.connect(),r=await t.getFee();let n=t.xrpToDrops(r);new l.default(n).gt("2000")&&(n="12");const i=e.payload&&Array.isArray(e.payload.blocks)?e.payload.blocks.map((()=>({feePerUnit:n}))):[{feePerUnit:n}];return{type:h.RESPONSES.ESTIMATE_FEE,payload:i}})(e);case h.MESSAGES.PUSH_TRANSACTION:return(async({connect:e,payload:t})=>{const r=await e(),n=await r.submit(t.toUpperCase());if("tesSUCCESS"===n.resultCode)return{type:h.RESPONSES.PUSH_TRANSACTION,payload:n.tx_json.hash};throw new Error(n.resultMessage)})(e);case h.MESSAGES.SUBSCRIBE:return b(e);case h.MESSAGES.UNSUBSCRIBE:return _(e);default:throw new d.CustomError("worker_unknown_request",`+${e.type}`)}};class M extends f.BaseWorker{cleanup(){this.pingTimeout&&clearTimeout(this.pingTimeout),this.api&&this.api.removeAllListeners(),super.cleanup()}isConnected(e){var t;return null!==(t=null==e?void 0:e.isConnected())&&void 0!==t&&t}async tryConnect(e){const t={server:e,connectionTimeout:this.settings.timeout||2e4};u.RippleAPI._ALLOW_AGENT&&(t.agent=this.proxyAgent);const r=new u.RippleAPI(t);return r.connection.reconnect=()=>new n((()=>{})),await r.connect(),r.on("ledger",(e=>{m.BASE=r.xrpToDrops(e.reserveBaseXRP),m.OWNER=r.xrpToDrops(e.reserveIncrementXRP)})),r.on("disconnected",(()=>{this.post({id:-1,type:h.RESPONSES.DISCONNECTED,payload:!0}),this.cleanup()})),this.post({id:-1,type:h.RESPONSES.CONNECTED}),r}disconnect(){this.api&&this.api.disconnect()}async messageHandler(e){try{if(await super.messageHandler(e))return!0;const t=Object.assign(Object.assign({},e.data),{connect:()=>this.connect(),post:e=>this.post(e),state:this.state}),r=await w(t);this.post(Object.assign({id:e.data.id},r))}catch(t){this.errorResponse(e.data.id,(e=>{if(e instanceof c.RippleError){const t="TimeoutError"===e.name?"websocket_timeout":"websocket_error_message";return e.data?new d.CustomError(t,`${e.name} ${e.data.error_message}`):new d.CustomError(t,e.toString())}return e})(t))}finally{e.data.type!==h.MESSAGES.DISCONNECT&&this.setPingTimeout()}}setPingTimeout(){this.pingTimeout&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout((()=>this.onPing()),this.settings.pingTimeout||18e4)}async onPing(){if(this.api&&this.api.isConnected())if(this.state.hasSubscriptions()||this.settings.keepAlive){try{await this.api.getServerInfo()}catch(e){this.debug(`Error in timeout ping request: ${e}`)}this.setPingTimeout()}else this.api.disconnect()}}if(t.default=function(){return new M},"worker"===f.CONTEXT){const e=new M;onmessage=e.messageHandler.bind(e)}},"?98fd":()=>{},"?2e65":()=>{},"?0749":()=>{},"?e376":()=>{},"?7dc1":()=>{},"?f84f":()=>{},"?4c42":()=>{},"?c86f":()=>{},"?1dff":()=>{},"?983a":()=>{},"?0a88":()=>{},"?2ae8":()=>{},"../../node_modules/available-typed-arrays/index.js":(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t{"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},"../../node_modules/browserify-sign/browser/algorithms.json":e=>{"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},"../../node_modules/browserify-sign/browser/curves.json":e=>{"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},"../../node_modules/diffie-hellman/lib/primes.json":e=>{"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},"../../node_modules/elliptic/package.json":e=>{"use strict";e.exports={i8:"6.5.4"}},"../../node_modules/parse-asn1/aesid.json":e=>{"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},"../../node_modules/ripple-binary-codec/dist/enums/definitions.json":e=>{"use strict";e.exports=JSON.parse('{"TYPES":{"Validation":10003,"Done":-1,"Hash128":4,"Blob":7,"AccountID":8,"Amount":6,"Hash256":5,"UInt8":16,"Vector256":19,"STObject":14,"Unknown":-2,"Transaction":10001,"Hash160":17,"PathSet":18,"LedgerEntry":10002,"UInt16":1,"NotPresent":0,"UInt64":3,"UInt32":2,"STArray":15},"LEDGER_ENTRY_TYPES":{"Any":-3,"Child":-2,"Invalid":-1,"AccountRoot":97,"DirectoryNode":100,"RippleState":114,"Ticket":84,"SignerList":83,"Offer":111,"LedgerHashes":104,"Amendments":102,"FeeSettings":115,"Escrow":117,"PayChannel":120,"DepositPreauth":112,"Check":67,"Nickname":110,"Contract":99,"NFTokenPage":80,"NFTokenOffer":55,"NegativeUNL":78},"FIELDS":[["Generic",{"nth":0,"isVLEncoded":false,"isSerialized":false,"isSigningField":false,"type":"Unknown"}],["Invalid",{"nth":-1,"isVLEncoded":false,"isSerialized":false,"isSigningField":false,"type":"Unknown"}],["LedgerEntryType",{"nth":1,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt16"}],["TransactionType",{"nth":2,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt16"}],["SignerWeight",{"nth":3,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt16"}],["TransferFee",{"nth":4,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt16"}],["Flags",{"nth":2,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["SourceTag",{"nth":3,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["Sequence",{"nth":4,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["PreviousTxnLgrSeq",{"nth":5,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["LedgerSequence",{"nth":6,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["CloseTime",{"nth":7,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["ParentCloseTime",{"nth":8,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["SigningTime",{"nth":9,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["Expiration",{"nth":10,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["TransferRate",{"nth":11,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["WalletSize",{"nth":12,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["OwnerCount",{"nth":13,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["DestinationTag",{"nth":14,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["HighQualityIn",{"nth":16,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["HighQualityOut",{"nth":17,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["LowQualityIn",{"nth":18,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["LowQualityOut",{"nth":19,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["QualityIn",{"nth":20,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["QualityOut",{"nth":21,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["StampEscrow",{"nth":22,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["BondAmount",{"nth":23,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["LoadFee",{"nth":24,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["OfferSequence",{"nth":25,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["FirstLedgerSequence",{"nth":26,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["LastLedgerSequence",{"nth":27,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["TransactionIndex",{"nth":28,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["OperationLimit",{"nth":29,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["ReferenceFeeUnits",{"nth":30,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["ReserveBase",{"nth":31,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["ReserveIncrement",{"nth":32,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["SetFlag",{"nth":33,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["ClearFlag",{"nth":34,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["SignerQuorum",{"nth":35,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["CancelAfter",{"nth":36,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["FinishAfter",{"nth":37,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["IndexNext",{"nth":1,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["IndexPrevious",{"nth":2,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["BookNode",{"nth":3,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["OwnerNode",{"nth":4,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["BaseFee",{"nth":5,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["ExchangeRate",{"nth":6,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["LowNode",{"nth":7,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["HighNode",{"nth":8,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["EmailHash",{"nth":1,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash128"}],["LedgerHash",{"nth":1,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["ParentHash",{"nth":2,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["TransactionHash",{"nth":3,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["AccountHash",{"nth":4,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["PreviousTxnID",{"nth":5,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["LedgerIndex",{"nth":6,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["WalletLocator",{"nth":7,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["RootIndex",{"nth":8,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["AccountTxnID",{"nth":9,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["NFTokenID",{"nth":10,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["BookDirectory",{"nth":16,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["InvoiceID",{"nth":17,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["Nickname",{"nth":18,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["Amendment",{"nth":19,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["TicketID",{"nth":20,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["Digest",{"nth":21,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["hash",{"nth":257,"isVLEncoded":false,"isSerialized":false,"isSigningField":false,"type":"Hash256"}],["index",{"nth":258,"isVLEncoded":false,"isSerialized":false,"isSigningField":false,"type":"Hash256"}],["Amount",{"nth":1,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["Balance",{"nth":2,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["LimitAmount",{"nth":3,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["TakerPays",{"nth":4,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["TakerGets",{"nth":5,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["LowLimit",{"nth":6,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["HighLimit",{"nth":7,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["Fee",{"nth":8,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["SendMax",{"nth":9,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["DeliverMin",{"nth":10,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["MinimumOffer",{"nth":16,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["RippleEscrow",{"nth":17,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["DeliveredAmount",{"nth":18,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["NFTokenBrokerFee",{"nth":19,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Amount"}],["taker_gets_funded",{"nth":258,"isVLEncoded":false,"isSerialized":false,"isSigningField":false,"type":"Amount"}],["taker_pays_funded",{"nth":259,"isVLEncoded":false,"isSerialized":false,"isSigningField":false,"type":"Amount"}],["PublicKey",{"nth":1,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["MessageKey",{"nth":2,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["SigningPubKey",{"nth":3,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["TxnSignature",{"nth":4,"isVLEncoded":true,"isSerialized":true,"isSigningField":false,"type":"Blob"}],["URI",{"nth":5,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["Signature",{"nth":6,"isVLEncoded":true,"isSerialized":true,"isSigningField":false,"type":"Blob"}],["Domain",{"nth":7,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["FundCode",{"nth":8,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["RemoveCode",{"nth":9,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["ExpireCode",{"nth":10,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["CreateCode",{"nth":11,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["MemoType",{"nth":12,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["MemoData",{"nth":13,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["MemoFormat",{"nth":14,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["Fulfillment",{"nth":16,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["Condition",{"nth":17,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["MasterSignature",{"nth":18,"isVLEncoded":true,"isSerialized":true,"isSigningField":false,"type":"Blob"}],["UNLModifyValidator",{"nth":19,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["ValidatorToDisable",{"nth":20,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["ValidatorToReEnable",{"nth":21,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Blob"}],["Account",{"nth":1,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"AccountID"}],["Owner",{"nth":2,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"AccountID"}],["Destination",{"nth":3,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"AccountID"}],["Issuer",{"nth":4,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"AccountID"}],["Authorize",{"nth":5,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"AccountID"}],["Unauthorize",{"nth":6,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"AccountID"}],["Target",{"nth":7,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"AccountID"}],["RegularKey",{"nth":8,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"AccountID"}],["NFTokenMinter",{"nth":9,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"AccountID"}],["ObjectEndMarker",{"nth":1,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["TransactionMetaData",{"nth":2,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["CreatedNode",{"nth":3,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["DeletedNode",{"nth":4,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["ModifiedNode",{"nth":5,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["PreviousFields",{"nth":6,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["FinalFields",{"nth":7,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["NewFields",{"nth":8,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["TemplateEntry",{"nth":9,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["Memo",{"nth":10,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["SignerEntry",{"nth":11,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["NFToken",{"nth":12,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["Signer",{"nth":16,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["Majority",{"nth":18,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["DisabledValidator",{"nth":19,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STObject"}],["ArrayEndMarker",{"nth":1,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STArray"}],["Signers",{"nth":3,"isVLEncoded":false,"isSerialized":true,"isSigningField":false,"type":"STArray"}],["SignerEntries",{"nth":4,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STArray"}],["Template",{"nth":5,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STArray"}],["Necessary",{"nth":6,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STArray"}],["Sufficient",{"nth":7,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STArray"}],["AffectedNodes",{"nth":8,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STArray"}],["Memos",{"nth":9,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STArray"}],["NFTokens",{"nth":10,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STArray"}],["Majorities",{"nth":16,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STArray"}],["DisabledValidators",{"nth":17,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"STArray"}],["CloseResolution",{"nth":1,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt8"}],["Method",{"nth":2,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt8"}],["TransactionResult",{"nth":3,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt8"}],["TakerPaysCurrency",{"nth":1,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash160"}],["TakerPaysIssuer",{"nth":2,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash160"}],["TakerGetsCurrency",{"nth":3,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash160"}],["TakerGetsIssuer",{"nth":4,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash160"}],["Paths",{"nth":1,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"PathSet"}],["Indexes",{"nth":1,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Vector256"}],["Hashes",{"nth":2,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Vector256"}],["Amendments",{"nth":3,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Vector256"}],["NFTokenOffers",{"nth":4,"isVLEncoded":true,"isSerialized":true,"isSigningField":true,"type":"Vector256"}],["Transaction",{"nth":1,"isVLEncoded":false,"isSerialized":false,"isSigningField":false,"type":"Transaction"}],["LedgerEntry",{"nth":1,"isVLEncoded":false,"isSerialized":false,"isSigningField":false,"type":"LedgerEntry"}],["Validation",{"nth":1,"isVLEncoded":false,"isSerialized":false,"isSigningField":false,"type":"Validation"}],["SignerListID",{"nth":38,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["SettleDelay",{"nth":39,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["TicketCount",{"nth":40,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["TicketSequence",{"nth":41,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["NFTokenTaxon",{"nth":42,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["MintedNFTokens",{"nth":43,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["BurnedNFTokens",{"nth":44,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt32"}],["Channel",{"nth":22,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["ConsensusHash",{"nth":23,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["CheckID",{"nth":24,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["ValidatedHash",{"nth":25,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["PreviousPageMin",{"nth":26,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["NextPageMin",{"nth":27,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["NFTokenBuyOffer",{"nth":28,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["NFTokenSellOffer",{"nth":29,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"Hash256"}],["TickSize",{"nth":16,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt8"}],["UNLModifyDisabling",{"nth":17,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt8"}],["DestinationNode",{"nth":9,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["Cookie",{"nth":10,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["ServerVersion",{"nth":11,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}],["NFTokenOfferNode",{"nth":12,"isVLEncoded":false,"isSerialized":true,"isSigningField":true,"type":"UInt64"}]],"TRANSACTION_RESULTS":{"telLOCAL_ERROR":-399,"telBAD_DOMAIN":-398,"telBAD_PATH_COUNT":-397,"telBAD_PUBLIC_KEY":-396,"telFAILED_PROCESSING":-395,"telINSUF_FEE_P":-394,"telNO_DST_PARTIAL":-393,"telCAN_NOT_QUEUE":-392,"telCAN_NOT_QUEUE_BALANCE":-391,"telCAN_NOT_QUEUE_BLOCKS":-390,"telCAN_NOT_QUEUE_BLOCKED":-389,"telCAN_NOT_QUEUE_FEE":-388,"telCAN_NOT_QUEUE_FULL":-387,"temMALFORMED":-299,"temBAD_AMOUNT":-298,"temBAD_CURRENCY":-297,"temBAD_EXPIRATION":-296,"temBAD_FEE":-295,"temBAD_ISSUER":-294,"temBAD_LIMIT":-293,"temBAD_OFFER":-292,"temBAD_PATH":-291,"temBAD_PATH_LOOP":-290,"temBAD_REGKEY":-289,"temBAD_SEND_XRP_LIMIT":-288,"temBAD_SEND_XRP_MAX":-287,"temBAD_SEND_XRP_NO_DIRECT":-286,"temBAD_SEND_XRP_PARTIAL":-285,"temBAD_SEND_XRP_PATHS":-284,"temBAD_SEQUENCE":-283,"temBAD_SIGNATURE":-282,"temBAD_SRC_ACCOUNT":-281,"temBAD_TRANSFER_RATE":-280,"temDST_IS_SRC":-279,"temDST_NEEDED":-278,"temINVALID":-277,"temINVALID_FLAG":-276,"temREDUNDANT":-275,"temRIPPLE_EMPTY":-274,"temDISABLED":-273,"temBAD_SIGNER":-272,"temBAD_QUORUM":-271,"temBAD_WEIGHT":-270,"temBAD_TICK_SIZE":-269,"temINVALID_ACCOUNT_ID":-268,"temCANNOT_PREAUTH_SELF":-267,"temUNCERTAIN":-266,"temUNKNOWN":-265,"temSEQ_AND_TICKET":-264,"temBAD_NFTOKEN_TRANSFER_FEE":-263,"tefFAILURE":-199,"tefALREADY":-198,"tefBAD_ADD_AUTH":-197,"tefBAD_AUTH":-196,"tefBAD_LEDGER":-195,"tefCREATED":-194,"tefEXCEPTION":-193,"tefINTERNAL":-192,"tefNO_AUTH_REQUIRED":-191,"tefPAST_SEQ":-190,"tefWRONG_PRIOR":-189,"tefMASTER_DISABLED":-188,"tefMAX_LEDGER":-187,"tefBAD_SIGNATURE":-186,"tefBAD_QUORUM":-185,"tefNOT_MULTI_SIGNING":-184,"tefBAD_AUTH_MASTER":-183,"tefINVARIANT_FAILED":-182,"tefTOO_BIG":-181,"tefNO_TICKET":-180,"tefNFTOKEN_IS_NOT_TRANSFERABLE":-179,"terRETRY":-99,"terFUNDS_SPENT":-98,"terINSUF_FEE_B":-97,"terNO_ACCOUNT":-96,"terNO_AUTH":-95,"terNO_LINE":-94,"terOWNERS":-93,"terPRE_SEQ":-92,"terLAST":-91,"terNO_RIPPLE":-90,"terQUEUED":-89,"terPRE_TICKET":-88,"tesSUCCESS":0,"tecCLAIM":100,"tecPATH_PARTIAL":101,"tecUNFUNDED_ADD":102,"tecUNFUNDED_OFFER":103,"tecUNFUNDED_PAYMENT":104,"tecFAILED_PROCESSING":105,"tecDIR_FULL":121,"tecINSUF_RESERVE_LINE":122,"tecINSUF_RESERVE_OFFER":123,"tecNO_DST":124,"tecNO_DST_INSUF_XRP":125,"tecNO_LINE_INSUF_RESERVE":126,"tecNO_LINE_REDUNDANT":127,"tecPATH_DRY":128,"tecUNFUNDED":129,"tecNO_ALTERNATIVE_KEY":130,"tecNO_REGULAR_KEY":131,"tecOWNERS":132,"tecNO_ISSUER":133,"tecNO_AUTH":134,"tecNO_LINE":135,"tecINSUFF_FEE":136,"tecFROZEN":137,"tecNO_TARGET":138,"tecNO_PERMISSION":139,"tecNO_ENTRY":140,"tecINSUFFICIENT_RESERVE":141,"tecNEED_MASTER_KEY":142,"tecDST_TAG_NEEDED":143,"tecINTERNAL":144,"tecOVERSIZE":145,"tecCRYPTOCONDITION_ERROR":146,"tecINVARIANT_FAILED":147,"tecEXPIRED":148,"tecDUPLICATE":149,"tecKILLED":150,"tecHAS_OBLIGATIONS":151,"tecTOO_SOON":152,"tecMAX_SEQUENCE_REACHED":154,"tecNO_SUITABLE_NFTOKEN_PAGE":155,"tecNFTOKEN_BUY_SELL_MISMATCH":156,"tecNFTOKEN_OFFER_TYPE_MISMATCH":157,"tecCANT_ACCEPT_OWN_NFTOKEN_OFFER":158,"tecINSUFFICIENT_FUNDS":159,"tecOBJECT_NOT_FOUND":160,"tecINSUFFICIENT_PAYMENT":161,"tecINCORRECT_ASSET":162,"tecTOO_MANY":163},"TRANSACTION_TYPES":{"Invalid":-1,"Payment":0,"EscrowCreate":1,"EscrowFinish":2,"AccountSet":3,"EscrowCancel":4,"SetRegularKey":5,"NickNameSet":6,"OfferCreate":7,"OfferCancel":8,"Contract":9,"TicketCreate":10,"TicketCancel":11,"SignerListSet":12,"PaymentChannelCreate":13,"PaymentChannelFund":14,"PaymentChannelClaim":15,"CheckCreate":16,"CheckCash":17,"CheckCancel":18,"DepositPreauth":19,"TrustSet":20,"AccountDelete":21,"NFTokenMint":25,"NFTokenBurn":26,"NFTokenCreateOffer":27,"NFTokenCancelOffer":28,"NFTokenAcceptOffer":29,"EnableAmendment":100,"SetFee":101,"UNLModify":102}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/api-options.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"api-options","type":"object","properties":{"trace":{"type":"boolean","description":"If true, log rippled requests and responses to stdout."},"feeCushion":{"type":"number","minimum":1,"description":"Factor to multiply estimated fee by to provide a cushion in case the required fee rises during submission of a transaction. Defaults to `1.2`."},"maxFeeXRP":{"type":"string","description":"Maximum fee to use with transactions, in XRP. Must be a string-encoded number. Defaults to `\'2\'`."},"server":{"type":"string","description":"URI for rippled websocket port to connect to. Must start with `wss://`, `ws://`, `wss+unix://`, or `ws+unix://`.","format":"uri","pattern":"^(wss?|wss?\\\\+unix)://"},"proxy":{"format":"uri","description":"URI for HTTP/HTTPS proxy to use to connect to the rippled server."},"agent":{"format":"object","description":"Proxy agent to use to connect to the rippled server."},"timeout":{"type":"integer","description":"Request timeout in milliseconds before considering a request to have failed. See also: connectionTimeout.","minimum":1},"connectionTimeout":{"type":"integer","description":"Connection timeout, in milliseconds, before considering connect() to have failed.","minimum":1},"proxyAuthorization":{"type":"string","description":"Username and password for HTTP basic authentication to the proxy in the format **username:password**."},"authorization":{"type":"string","description":"Username and password for HTTP basic authentication to the rippled server in the format **username:password**."},"trustedCertificates":{"type":"array","description":"Array of PEM-formatted SSL certificates to trust when connecting to a proxy. This is useful if you want to use a self-signed certificate on the proxy server. Note: Each element must contain a single certificate; concatenated certificates are not valid.","items":{"type":"string","description":"A PEM-formatted SSL certificate to trust when connecting to a proxy."}},"key":{"type":"string","description":"A string containing the private key of the client in PEM format. (Can be an array of keys)."},"passphrase":{"type":"string","description":"The passphrase for the private key of the client."},"certificate":{"type":"string","description":"A string containing the certificate key of the client in PEM format. (Can be an array of certificates)."}},"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/combine.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"combineParameters","type":"object","properties":{"signedTransactions":{"type":"array","description":"An array of signed transactions (from the output of [sign](#sign)) to combine.","items":{"type":"string","pattern":"^[A-F0-9]+$","description":"A single-signed transaction represented as an uppercase hexadecimal string (from the output of [sign](#sign))"},"minLength":1}},"additionalProperties":false,"required":["signedTransactions"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/compute-ledger-hash.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"computeLedgerHashParameters","type":"object","properties":{"ledger":{"$ref":"getLedger","description":"The ledger header to hash."}},"additionalProperties":false,"required":["ledger"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/generate-address.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"generateAddressParameters","type":"object","properties":{"options":{"type":"object","description":"Options to control how the address and secret are generated.","properties":{"entropy":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255},"description":"The entropy to use to generate the seed. Must be an array of length 16 with values from 0-255 (16 bytes of entropy)"},"algorithm":{"type":"string","enum":["ecdsa-secp256k1","ed25519"],"description":"The digital signature algorithm to generate an address for. Can be `ecdsa-secp256k1` (default) or `ed25519`."},"test":{"type":"boolean","description":"Specifies whether the address is intended for use on a test network such as Testnet or Devnet. If `true`, the address should only be used for testing, and starts with `T`. If `false`, the address should only be used on Mainnet, and starts with `X`."},"includeClassicAddress":{"type":"boolean","description":"If `true`, also return the classic address."}},"additionalProperties":false}},"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-account-info.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getAccountInfoParameters","description":"Parameters for getAccountInfo","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account to get the account info of."},"options":{"description":"Options that affect what to return.","properties":{"ledgerVersion":{"$ref":"ledgerVersion","description":"Get the account info as of this historical ledger version."}},"additionalProperties":false}},"required":["address"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-account-objects.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getAccountObjectsOptions","description":"Request options for getAccountObjects","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account to get the account objects of."},"options":{"description":"Options that affect what to return.","properties":{"type":{"type":"string","enum":["check","escrow","offer","payment_channel","signer_list","state"],"description":"(Optional) Filter results to include only this type of ledger object. The valid types are: `check`, `escrow`, `offer`, `payment_channel`, `signer_list`, and `state` (trust line)."},"ledgerHash":{"type":"string","description":"(Optional) A 20-byte hex string for the ledger version to use."},"ledgerIndex":{"oneOf":[{"$ref":"ledgerVersion"},{"type":"string"}],"description":"(Optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically."},"limit":{"type":"integer","minimum":1,"description":"(Optional) The maximum number of objects to include in the results."}},"additionalProperties":false}},"required":["address"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-balance-sheet.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getBalanceSheetParameters","description":"Parameters for getBalanceSheet","type":"object","properties":{"address":{"$ref":"address","description":"The XRP Ledger address of the account to get the balance sheet of."},"options":{"properties":{"excludeAddresses":{"type":"array","items":{"$ref":"address"},"uniqueItems":true,"description":"Addresses to exclude from the balance totals."},"ledgerVersion":{"$ref":"ledgerVersion","description":"Get the balance sheet as of this historical ledger version."}},"description":"Options to determine how the balances are calculated.","additionalProperties":false}},"additionalProperties":false,"required":["address"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-balances.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getBalancesParameters","description":"Parameters for getBalances","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account to get balances for."},"options":{"description":"Options to filter and determine which balances to return.","properties":{"counterparty":{"$ref":"address","description":"Only return balances with this counterparty."},"currency":{"$ref":"currency","description":"Only return balances for this currency."},"limit":{"type":"integer","minimum":1,"description":"Return at most this many balances."},"ledgerVersion":{"$ref":"ledgerVersion","description":"Return balances as they were in this historical ledger version."}},"additionalProperties":false}},"additionalProperties":false,"required":["address"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-ledger.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getLedgerParameters","description":"Parameters for getLedger","type":"object","properties":{"options":{"description":"Options affecting what ledger and how much data to return.","properties":{"ledgerHash":{"type":"string","description":"Get ledger data for this historical ledger hash."},"ledgerVersion":{"$ref":"ledgerVersion","description":"Get ledger data for this historical ledger version."},"includeAllData":{"type":"boolean","description":"Include the details of the transactions or state information if `includeTransactions` or `includeState` is set."},"includeTransactions":{"type":"boolean","description":"Return an array of transactions in this ledger. By default, provides the identifying hashes for each transaction. If `includeAllData` is true, include the entire transaction JSON for each transaction instead."},"includeState":{"type":"boolean","description":"Return an array of state data in this ledger. By default, provides the identifying hashes of state data. If `includeAllData` is true, return the state data in JSON form instead. **Admin required:** This is a very large amount of data."}},"additionalProperties":false}},"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-orderbook.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getOrderbookParameters","description":"Parameters for getOrderbook","type":"object","properties":{"address":{"$ref":"address","description":"Address of an account to use as point-of-view. (This affects which unfunded offers are returned.)"},"orderbook":{"$ref":"orderbook","description":"The order book to get."},"options":{"description":"Options to determine what to return.","properties":{"limit":{"type":"integer","minimum":1,"description":"Return at most this many orders from the order book."},"ledgerVersion":{"$ref":"ledgerVersion","description":"Return the order book as of this historical ledger version."}},"additionalProperties":false}},"required":["address","orderbook"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-orders.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getOrdersParameters","description":"Parameters for getOrders","type":"object","properties":{"address":{"$ref":"address","description":"The XRP Ledger address of the account to get open orders for."},"options":{"description":"Options that determine what orders to return.","properties":{"limit":{"type":"integer","minimum":1,"description":"Return at most this many orders."},"ledgerVersion":{"$ref":"ledgerVersion","description":"Return orders as of this historical ledger version."}},"additionalProperties":false}},"required":["address"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-paths.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getPathsParameters","type":"object","properties":{"pathfind":{"description":"Specification of a pathfind request.","properties":{"source":{"description":"Properties of the source of funds.","type":"object","properties":{"address":{"$ref":"address","description":"The XRP Ledger address of the planned sender."},"amount":{"$ref":"laxAmount","description":"The amount of funds to send."},"currencies":{"description":"An array of currencies (with optional counterparty) that may be used in the payment paths.","type":"array","items":{"description":"A currency with optional counterparty.","type":"object","properties":{"currency":{"$ref":"currency"},"counterparty":{"$ref":"address","description":"The counterparty for the currency; if omitted any counterparty may be used."}},"required":["currency"],"additionalProperties":false},"uniqueItems":true}},"not":{"required":["amount","currencies"]},"additionalProperties":false,"required":["address"]},"destination":{"description":"Properties of the destination of funds.","type":"object","properties":{"address":{"$ref":"address","description":"An address representing the destination of the transaction."},"amount":{"$ref":"laxLaxAmount","description":"The amount to be received by the receiver (`value` may be ommitted if a source amount is specified)."}},"required":["address","amount"],"additionalProperties":false}},"required":["source","destination"],"additionalProperties":false}},"additionalProperties":false,"required":["pathfind"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-payment-channel.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getPaymentChannelParameters","description":"Parameters for getPaymentChannel","type":"object","properties":{"id":{"$ref":"hash256","description":"256-bit hexadecimal channel identifier."}},"additionalProperties":false,"required":["id"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-settings.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getSettingsParameters","description":"Parameters for getSettings","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account to get the settings of."},"options":{"description":"Options that affect what to return.","properties":{"ledgerVersion":{"$ref":"ledgerVersion","description":"Get the settings as of this historical ledger version."}},"additionalProperties":false}},"required":["address"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-transaction.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getTransactionParameters","description":"Parameters for getTransaction","type":"object","properties":{"id":{"$ref":"transactionHash"},"options":{"description":"Options to limit the ledger versions to search or include raw transaction data.","properties":{"minLedgerVersion":{"$ref":"ledgerVersion","description":"The lowest ledger version to search. This must be an integer greater than 0, or one of the following strings: \'validated\', \'closed\', \'current\'."},"maxLedgerVersion":{"$ref":"ledgerVersion","description":"The highest ledger version to search. This must be an integer greater than 0, or one of the following strings: \'validated\', \'closed\', \'current\'."},"includeRawTransaction":{"description":"Include raw transaction data. For advanced users; exercise caution when interpreting this data."}},"additionalProperties":false}},"additionalProperties":false,"required":["id"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-transactions.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getTransactionsParameters","description":"Parameters for getTransactions","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account to get transactions for."},"options":{"description":"Options to filter the resulting transactions.","properties":{"start":{"$ref":"hash256","description":"If specified, start the results from this transaction. You cannot use `start` with `minLedgerVersion` or `maxLedgerVersion`. When `start` is specified, these ledger versions are determined internally."},"limit":{"type":"integer","minimum":1,"description":"If specified, return at most this many transactions."},"minLedgerVersion":{"$ref":"ledgerVersion","description":"Return only transactions in this ledger version or higher."},"maxLedgerVersion":{"$ref":"ledgerVersion","description":"Return only transactions in this ledger version or lower."},"earliestFirst":{"type":"boolean","description":"If true, sort transactions so that the earliest ones come first. By default, the newest transactions come first."},"excludeFailures":{"type":"boolean","description":"If true, the result omits transactions that did not succeed."},"initiated":{"type":"boolean","description":"If true, return only transactions initiated by the account specified by `address`. If false, return only transactions not initiated by the account specified by `address`."},"counterparty":{"$ref":"address","description":"If provided, only return transactions with this account as a counterparty to the transaction."},"types":{"type":"array","items":{"$ref":"transactionType"},"description":"Only return transactions of the specified [Transaction Types](#transaction-types)."},"includeRawTransactions":{"description":"Include raw transaction data. For advanced users; exercise caution when interpreting this data. "},"binary":{"type":"boolean","description":"If true, return transactions in binary format rather than JSON."}},"additionalProperties":false,"not":{"anyOf":[{"required":["start","minLedgerVersion"]},{"required":["start","maxLedgerVersion"]}]}}},"additionalProperties":false,"required":["address"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/get-trustlines.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getTrustlinesParameters","description":"Parameters for getTrustlines","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account to get trustlines for."},"options":{"description":"Options to filter and determine which trustlines to return.","properties":{"counterparty":{"$ref":"address","description":"Only return trustlines with this counterparty."},"currency":{"$ref":"currency","description":"Only return trustlines for this currency."},"limit":{"type":"integer","minimum":1,"description":"Return at most this many trustlines."},"ledgerVersion":{"$ref":"ledgerVersion","description":"Return trustlines as they were in this historical ledger version."}},"additionalProperties":false}},"additionalProperties":false,"required":["address"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-check-cancel.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareCheckCancelParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"checkCancel":{"$ref":"checkCancel","description":"The specification of the Check cancellation to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","checkCancel"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-check-cash.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareCheckCashParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"checkCash":{"$ref":"checkCash","description":"The specification of the Check cash to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","checkCash"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-check-create.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareCheckCreateParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"checkCreate":{"$ref":"checkCreate","description":"The specification of the Check create creation to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","checkCreate"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-escrow-cancellation.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareEscrowCancellationParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"escrowCancellation":{"$ref":"escrowCancellation","description":"The specification of the escrow cancellation to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","escrowCancellation"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-escrow-creation.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareEscrowCreationParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"escrowCreation":{"$ref":"escrowCreation","description":"The specification of the escrow creation to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","escrowCreation"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-escrow-execution.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareEscrowExecutionParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"escrowExecution":{"$ref":"escrowExecution","description":"The specification of the escrow execution to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","escrowExecution"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-order-cancellation.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareOrderCancellationParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"orderCancellation":{"$ref":"orderCancellation","description":"The specification of the order cancellation to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","orderCancellation"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-order.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareOrderParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"order":{"$ref":"order","description":"The specification of the order to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","order"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-payment-channel-claim.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"preparePaymentChannelClaimParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"paymentChannelClaim":{"$ref":"paymentChannelClaim","description":"Details of the channel and claim."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","paymentChannelClaim"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-payment-channel-create.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"preparePaymentChannelCreateParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"paymentChannelCreate":{"$ref":"paymentChannelCreate","description":"The specification of the payment channel to create."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","paymentChannelCreate"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-payment-channel-fund.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"preparePaymentChannelFundParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"paymentChannelFund":{"$ref":"paymentChannelFund","description":"The channel to fund, and the details of how to fund it."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","paymentChannelFund"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-payment.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"preparePaymentParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"payment":{"$ref":"payment","description":"The specification of the payment to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","payment"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-settings.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareSettingsParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"settings":{"$ref":"settings","description":"The specification of the settings to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","settings"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-ticket-create.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareTicketParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"ticketCount":{"type":"number","description":"The number of tickets to be created."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","ticketCount"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/prepare-trustline.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepareTrustlineParameters","type":"object","properties":{"address":{"$ref":"address","description":"The address of the account that is creating the transaction."},"trustline":{"$ref":"trustline","description":"The specification of the trustline to prepare."},"instructions":{"$ref":"instructions"}},"additionalProperties":false,"required":["address","trustline"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/sign-payment-channel-claim.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"signPaymentChannelClaimParameters","type":"object","properties":{"channel":{"$ref":"hash256","description":"256-bit hexadecimal channel identifier."},"amount":{"$ref":"value","description":"Amount of XRP authorized by the claim."},"privateKey":{"$ref":"publicKey","description":"The private key to sign the payment channel claim."}},"additionalProperties":false,"required":["channel","amount","privateKey"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/sign.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"signParameters","type":"object","properties":{"txJSON":{"type":"string","description":"Transaction represented as a JSON string in rippled format."},"secret":{"type":"string","format":"secret","description":"The secret of the account that is initiating the transaction. (This field cannot be used with keypair)."},"keypair":{"type":"object","properties":{"privateKey":{"type":"privateKey","description":"The uppercase hexadecimal representation of the secp256k1 or Ed25519 private key. Ed25519 keys are prefixed with 0xED. You can read about how keys are derived [here](https://xrpl.org/cryptographic-keys.html)."},"publicKey":{"type":"publicKey","description":"The uppercase hexadecimal representation of the secp256k1 or Ed25519 public key. Ed25519 keys are prefixed with 0xED. You can read about how keys are derived [here](https://xrpl.org/cryptographic-keys.html)."}},"description":"The private and public key of the account that is initiating the transaction. (This field cannot be used with secret).","required":["privateKey","publicKey"],"additionalProperties":false},"options":{"type":"object","description":"Options that control the type of signature to create.","properties":{"signAs":{"$ref":"address","description":"The account that the signature should count for in multisigning."}},"additionalProperties":false}},"additionalProperties":false,"required":["txJSON"],"oneOf":[{"required":["secret"],"not":{"required":["keypair"]}},{"required":["keypair"],"not":{"required":["secret"]}}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/submit.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"submitParameters","type":"object","properties":{"signedTransaction":{"$ref":"blob","description":"A signed transaction as returned by [sign](#sign)."},"failHard":{"type":"boolean","description":"If `true`, and the transaction fails locally, do not retry or relay the transaction to other servers. Defaults to `false`."}},"additionalProperties":false,"required":["signedTransaction"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/input/verify-payment-channel-claim.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"verifyPaymentChannelClaimParameters","type":"object","properties":{"channel":{"$ref":"hash256","description":"256-bit hexadecimal channel identifier."},"amount":{"$ref":"value","description":"Amount of XRP authorized by the claim."},"signature":{"$ref":"signature","description":"Signature of this claim."},"publicKey":{"$ref":"publicKey","description":"Public key of the channel\'s sender"}},"additionalProperties":false,"required":["channel","amount","signature","publicKey"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/address.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"address","description":"An account address on the XRP Ledger","type":"string","format":"address","link":"address","oneOf":[{"$ref":"xAddress"},{"$ref":"classicAddress"}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/adjustment.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"adjustment","type":"object","properties":{"address":{"$ref":"address"},"amount":{"$ref":"amount"},"tag":{"$ref":"tag"}},"required":["address","amount"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/amount.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"amount","link":"amount","description":"An Amount on the XRP Ledger","allOf":[{"$ref":"amountbase"},{"required":["value"]}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/amountbase.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"amountbase","description":"Base class for amount and issue","type":"object","properties":{"value":{"description":"The quantity of the currency, denoted as a string so that it does not lose precision","$ref":"value"},"currency":{"description":"The three-character code or hexadecimal string used to denote currencies, or \\"drops\\" for the smallest unit of XRP.","$ref":"currency"},"counterparty":{"description":"The XRP Ledger address of the account that owes or is owed the funds (omitted if `currency` is \\"XRP\\" or \\"drops\\")","$ref":"address"}},"additionalProperties":false,"required":["currency"],"oneOf":[{"properties":{"currency":{"not":{"enum":["XRP","drops"]}}},"required":["counterparty"]},{"properties":{"currency":{"enum":["XRP","drops"]}},"not":{"required":["counterparty"]}}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/balance.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"balance","description":"Balance amount","link":"amount","type":"object","properties":{"value":{"description":"The balance on the trustline","$ref":"signedValue"},"currency":{"description":"The three-character code or hexadecimal string used to denote currencies","$ref":"currency"},"counterparty":{"description":"The XRP Ledger address of the account that owes or is owed the funds.","$ref":"address"}},"additionalProperties":false,"required":["currency","value"],"oneOf":[{"properties":{"currency":{"not":{"enum":["XRP"]}}},"required":["counterparty"]},{"properties":{"currency":{"enum":["XRP"]}},"not":{"required":["counterparty"]}}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/blob.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"blob","description":"An uppercase hexadecimal string representation of a transaction","type":"string","minLength":1,"pattern":"^[0-9A-F]*$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/classic-address.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"classicAddress","description":"A classic address (Account ID) for the XRP Ledger","type":"string","format":"classicAddress","link":"classic-address","pattern":"^r[1-9A-HJ-NP-Za-km-z]{24,34}$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/currency.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"currency","description":"The three-character code or hexadecimal string used to denote currencies","type":"string","link":"currency","pattern":"^([a-zA-Z0-9<>(){}[\\\\]|?!@#$%^&*]{3}|[A-F0-9]{40}|drops)$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/destination-address-tag.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"destinationAddressTag","description":"A destination address and optional tag, with no amount included. When parsing an incoming transaction, the original specification\'s amount is hidden to prevent misinterpretation. For the amount that the transaction delivered, see `outcome.deliveredAmount`.","type":"object","properties":{"address":{"$ref":"address","description":"An address representing the destination of the transaction."},"tag":{"$ref":"tag"}},"required":["address"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/destination-adjustment.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"destinationAdjustment","type":"object","oneOf":[{"$ref":"destinationExactAdjustment"},{"$ref":"minAdjustment"}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/destination-exact-adjustment.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"destinationExactAdjustment","type":"object","properties":{"address":{"$ref":"address","description":"An address representing the destination of the transaction."},"amount":{"$ref":"laxAmount","description":"An exact amount to deliver to the recipient. If the counterparty is not specified, amounts with any counterparty may be used. (This field cannot be used with `destination.minAmount`.)"},"tag":{"$ref":"tag"}},"required":["address","amount"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/hash128.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"hash128","description":"The hexadecimal representation of a 128-bit hash","type":"string","pattern":"^[A-F0-9]{32}$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/hash256.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"hash256","description":"The hexadecimal representation of a 256-bit hash","type":"string","pattern":"^[A-F0-9]{64}$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/instructions.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"instructions","link":"transaction-instructions","description":"Instructions for executing the transaction","type":"object","properties":{"sequence":{"description":"The initiating account\'s sequence number for this transaction. `sequence` and `ticketSequence` are mutually exclusive, only one of them can be set.","$ref":"sequence"},"ticketSequence":{"description":"The ticket sequence to be used for this transaction. `sequence` and `ticketSequence` are mutually exclusive, only one of them can be set.","$ref":"ticket-sequence"},"fee":{"description":"An exact fee to pay for the transaction, before multiplying for multi-signed transactions. See [Transaction Fees](#transaction-fees) for more information.","$ref":"value"},"maxFee":{"description":"Deprecated: Use `maxFeeXRP` in the RippleAPI constructor instead. The maximum fee to pay for this transaction. If this exceeds `maxFeeXRP`, use `maxFeeXRP` instead. See [Transaction Fees](#transaction-fees) for more information.","$ref":"value"},"maxLedgerVersion":{"description":"The highest ledger version that the transaction can be included in. If this option and `maxLedgerVersionOffset` are both omitted, the default is 3 greater than the current validated ledger version (equivalent to `maxLedgerVersionOffset=3`). Use `null` to not set a maximum ledger version. If not null, this must be an integer greater than 0, or one of the following strings: \'validated\', \'closed\', \'current\'.","oneOf":[{"$ref":"ledgerVersion"},{"type":"null"}]},"maxLedgerVersionOffset":{"description":"Offset from current validated ledger version to highest ledger version that the transaction can be included in.","type":"integer","minimum":0},"signersCount":{"description":"Number of signers that can multi-sign this transaction.","type":"integer","minimum":1}},"additionalProperties":false,"not":{"anyOf":[{"description":"fee and maxFee are mutually exclusive","required":["fee","maxFee"]},{"description":"maxLedgerVersion and maxLedgerVersionOffset are mutually exclusive","required":["maxLedgerVersion","maxLedgerVersionOffset"]},{"description":"sequence and ticketSequence are mutually exclusive","required":["sequence","ticketSequence"]}]}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/issue.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"issue","description":"The currency code, and the counterparty if it\'s not XRP.","allOf":[{"$ref":"amountbase"},{"not":{"required":["value"]}}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/lax-amount.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"laxAmount","description":"Amount where counterparty is optional","link":"amount","type":"object","properties":{"currency":{"$ref":"currency"},"counterparty":{"$ref":"address"},"value":{"$ref":"value"}},"required":["currency","value"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/lax-lax-amount.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"laxLaxAmount","description":"Amount where counterparty and value are optional","link":"amount","type":"object","properties":{"currency":{"$ref":"currency"},"counterparty":{"$ref":"address"},"value":{"$ref":"value"}},"required":["currency"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/ledger-version.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"ledgerVersion","description":"A ledger version number","oneOf":[{"type":"integer","minimum":1},{"type":"string","enum":["validated","closed","current"]}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/max-adjustment.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"maxAdjustment","type":"object","properties":{"address":{"$ref":"address","description":"The address to send from."},"maxAmount":{"$ref":"laxAmount","description":"The maximum amount to send. (This field cannot be used with source.amount)"},"tag":{"$ref":"tag"}},"required":["address","maxAmount"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/memo.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"memo","description":"Memo objects represent arbitrary data that can be included in a transaction","type":"object","properties":{"type":{"pattern":"^[A-Za-z0-9\\\\-._~:/?#[\\\\]@!$&\'()*+,;=%]*$","description":"Conventionally, a unique relation (according to [RFC 5988](http://tools.ietf.org/html/rfc5988#section-4)) that defines the format of this memo. Only characters allowed in URLs are permitted."},"format":{"pattern":"^[A-Za-z0-9\\\\-._~:/?#[\\\\]@!$&\'()*+,;=%]*$","description":"Conventionally containing information on how the memo is encoded, for example as a [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml). Only characters allowed in URLs are permitted."},"data":{"type":"string","description":"Arbitrary string, conventionally containing the content of the memo."}},"additionalProperties":false,"anyOf":[{"required":["data"]},{"required":["type"]}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/memos.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"memos","link":"transaction-memos","description":"Array of memos to attach to the transaction.","type":"array","items":{"$ref":"memo"}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/min-adjustment.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"minAdjustment","type":"object","properties":{"address":{"$ref":"address","description":"An address representing the destination of the transaction."},"minAmount":{"$ref":"laxAmount","description":"The minimum amount to be delivered. (This field cannot be used with destination.amount)"},"tag":{"$ref":"tag"}},"required":["address","minAmount"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/orderbook.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"orderbook","type":"object","properties":{"base":{"$ref":"issue"},"counter":{"$ref":"issue"}},"required":["base","counter"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/private-key.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"privateKey","description":"The hexadecimal representation of a secp256k1 or Ed25519 private key.","type":"string","pattern":"^[A-F0-9]+$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/public-key.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"publicKey","description":"The hexadecimal representation of a secp256k1 or Ed25519 public key.","type":"string","pattern":"^[A-F0-9]+$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/quality.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"quality","description":"Ratio for incoming/outgoing transit fees.","type":"number","minimum":1e-9,"maximum":4.294967295}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/sequence.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"sequence","link":"account-sequence-number","description":"An account transaction sequence number","type":"integer","minimum":0}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/settings-plus-memos.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"settingsPlusMemos","type":"object","properties":{"defaultRipple":{"type":"boolean","description":"Enable [rippling](https://xrpl.org/rippling.html) on this account’s trust lines by default. Currency issuers should enable this setting; most others should not."},"depositAuth":{"type":"boolean","description":"Enable [Deposit Authorization](https://xrpl.org/depositauth.html) on this account. If set, transactions cannot send value of any kind to this account unless the sender of those transactions is the account itself. (Requires the [DepositAuth amendment](https://xrpl.org/known-amendments.html#depositauth))"},"disableMasterKey":{"type":"boolean","description":"Disallows use of the master key to sign transactions for this account. To disable the master key, you must authorize the transaction by signing it with the master key pair. You cannot use a regular key pair or a multi-signature. You can re-enable the master key pair using a regular key pair or multi-signature. See [AccountSet](https://xrpl.org/accountset.html)."},"disallowIncomingXRP":{"type":"boolean","description":"Indicates that client applications should not send XRP to this account. Not enforced by rippled."},"domain":{"type":"string","description":"The domain that owns this account, as a hexadecimal string representing the ASCII for the domain in lowercase."},"emailHash":{"description":"Hash of an email address to be used for generating an avatar image. Conventionally, clients use Gravatar to display this image. Use `null` to clear.","oneOf":[{"type":"null"},{"$ref":"hash128"}]},"walletLocator":{"description":"Transaction hash or any other 64 character hexadecimal string, that may or may not represent the result of a hash operation. Use `null` to clear.","oneOf":[{"type":"null"},{"$ref":"hash256"}]},"enableTransactionIDTracking":{"type":"boolean","description":"Track the ID of this account’s most recent transaction."},"globalFreeze":{"type":"boolean","description":"Freeze all assets issued by this account."},"memos":{"$ref":"memos"},"messageKey":{"type":"string","description":"Public key for sending encrypted messages to this account. Conventionally, it should be a secp256k1 key, the same encryption that is used by the rest of Ripple."},"noFreeze":{"type":"boolean","description":"Permanently give up the ability to freeze individual trust lines. This flag can never be disabled after being enabled."},"passwordSpent":{"type":"boolean","description":"Indicates that the account has used its free SetRegularKey transaction."},"regularKey":{"oneOf":[{"$ref":"address"},{"type":"null"}],"description":"The public key of a new keypair, to use as the regular key to this account, as a base-58-encoded string in the same format as an account address. Use `null` to remove the regular key."},"requireAuthorization":{"type":"boolean","description":"If set, this account must individually give other users permission to hold this account’s issued tokens."},"requireDestinationTag":{"type":"boolean","description":"Requires incoming payments to specify a destination tag."},"signers":{"type":"object","description":"Settings that determine what sets of accounts can be used to sign a transaction on behalf of this account using multisigning.","properties":{"threshold":{"$ref":"uint32","description":"A target number for the signer weights. A multi-signature from this list is valid only if the sum weights of the signatures provided is equal or greater than this value. To delete the signers setting, use the value `0`."},"weights":{"type":"array","description":"Weights of signatures for each signer.","items":{"type":"object","description":"An association of an address and a weight.","properties":{"address":{"$ref":"address"},"weight":{"$ref":"uint32","description":"The weight that the signature of this account counts as towards the threshold."}},"required":["address","weight"],"additionalProperties":false},"minItems":1,"maxItems":8}},"required":["threshold"],"additionalProperties":false},"transferRate":{"description":"The fee to charge when users transfer this account’s issuances, as the decimal amount that must be sent to deliver 1 unit. Has precision up to 9 digits beyond the decimal point. Use `null` to set no fee.","oneOf":[{"type":"null"},{"type":"number","minimum":1,"maximum":4.294967295}]},"tickSize":{"description":"Tick size to use for offers involving a currency issued by this address. The exchange rates of those offers is rounded to this many significant digits. Valid values are 3 to 15 inclusive, or 0 to disable.","enum":[0,3,4,5,6,7,8,9,10,11,12,13,14,15]}},"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/signature.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"signature","description":"The hexadecimal representation of a signature.","type":"string","pattern":"^[A-F0-9]+$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/signed-value.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"signedValue","description":"A string representation of a floating point number","type":"string","link":"value","pattern":"^[-]?[0-9]*[.]?[0-9]+([eE][-+]?[0-9]+)?$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/source-adjustment.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"sourceAdjustment","type":"object","oneOf":[{"$ref":"sourceExactAdjustment"},{"$ref":"maxAdjustment"}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/source-exact-adjustment.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"sourceExactAdjustment","type":"object","properties":{"address":{"$ref":"address","description":"The address to send from."},"amount":{"$ref":"laxAmount","description":"An exact amount to send. If the counterparty is not specified, amounts with any counterparty may be used. (This field cannot be used with source.maxAmount)"},"tag":{"$ref":"tag"}},"required":["address","amount"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/tag.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"tag","description":"An arbitrary 32-bit unsigned integer. It typically maps to an off-ledger account; for example, a hosted wallet or exchange account.","type":"integer","$ref":"uint32"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/ticket-sequence.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"ticket-sequence","link":"account-sequence-number","description":"An account transaction tickt sequence number","type":"integer","minimum":1}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/transaction-hash.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"transactionHash","link":"transaction-id","description":"A hash of a transaction used to identify the transaction, represented in hexadecimal.","type":"string","pattern":"^[A-F0-9]{64}$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/transaction-type.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"transactionType","link":"transaction-types","description":"The type of the transaction.","type":"string","enum":["payment","order","orderCancellation","trustline","settings","escrowCreation","escrowCancellation","escrowExecution","paymentChannelCreate","paymentChannelFund","paymentChannelClaim","checkCreate","checkCancel","checkCash","depositPreauth","accountDelete"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/tx-json.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"tx-json","link":"https://xrpl.org/transaction-formats.html","description":"An object in rippled txJSON format","type":"object","properties":{"Account":{"$ref":"address"},"TransactionType":{"type":"string"}},"required":["Account","TransactionType"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/uint32.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"uint32","description":"A 32-bit unsigned integer","type":"integer","minimum":0,"maximum":4294967295}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/value.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"value","link":"value","description":"A string representation of a non-negative floating point number","type":"string","pattern":"^[0-9]*[.]?[0-9]+([eE][-+]?[0-9]+)?$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/objects/x-address.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"xAddress","description":"An XRP Ledger address in X-address format","type":"string","format":"xAddress","link":"x-address","pattern":"^[XT][1-9A-HJ-NP-Za-km-z]{46}$"}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-account-info.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getAccountInfo","type":"object","properties":{"sequence":{"$ref":"sequence","description":"The next (smallest unused) sequence number for this account."},"xrpBalance":{"$ref":"value","description":"The XRP balance owned by the account."},"ownerCount":{"type":"integer","minimum":0,"description":"Number of other ledger entries (specifically, trust lines and offers) attributed to this account. This is used to calculate the total reserve required to use the account."},"previousInitiatedTransactionID":{"$ref":"hash256","description":"Hash value representing the most recent transaction that was initiated by this account."},"previousAffectingTransactionID":{"$ref":"hash256","description":"Hash value representing the most recent transaction that affected this account node directly. **Note:** This does not include changes to the account’s trust lines and offers."},"previousAffectingTransactionLedgerVersion":{"$ref":"ledgerVersion","description":"The ledger version that the transaction identified by the `previousAffectingTransactionID` was validated in."}},"required":["sequence","xrpBalance","ownerCount","previousAffectingTransactionID","previousAffectingTransactionLedgerVersion"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-account-objects.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"AccountObjectsResponse","description":"Response format for account_objects","type":"object","properties":{"account":{"$ref":"address","description":"Unique address of the account this request corresponds to."},"account_objects":{"type":"array","items":{"type":"object"},"description":"Array of objects owned by this account. Each object is in its raw ledger format."},"ledger_hash":{"type":"string","description":"(May be omitted) The identifying hash of the ledger that was used to generate this response."},"ledger_index":{"$ref":"ledgerVersion","description":"(May be omitted) The sequence number of the ledger that was used to generate this response."},"ledger_current_index":{"$ref":"ledgerVersion","description":"(May be omitted) The sequence number of the ledger that was used to generate this response."},"limit":{"type":"integer","description":"(May be omitted) The limit that was used in this request, if any."},"validated":{"type":"boolean","description":"If included and set to true, the information in this request comes from a validated ledger version. Otherwise, the information is subject to change."}},"required":["account","account_objects"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-balance-sheet.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getBalanceSheet","description":"getBalanceSheet response","type":"object","properties":{"balances":{"type":"array","items":{"$ref":"amount"},"description":"Amounts issued to the \\"hotwallet\\" accounts from the request. The keys are the accounts\' addresses, and the values are arrays of currency amounts they hold. The issuer (omitted from the currency amounts) is the account from the request."},"assets":{"type":"array","items":{"$ref":"amount"},"description":"Total amounts held that are issued by others. For the recommended gateway configuration, there should be none."},"obligations":{"type":"array","items":{"type":"object","required":["currency","value"],"additionalProperties":false,"properties":{"currency":{"$ref":"currency"},"value":{"$ref":"value"}},"description":"An amount that is owed."},"description":"Total amounts issued to accounts that are not hot wallets, as a map of currencies to the total value issued."}},"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-balances.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getBalances","type":"array","items":{"$ref":"balance"}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-ledger.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getLedger","type":"object","properties":{"stateHash":{"$ref":"hash256","description":"Hash of all state information in this ledger."},"closeTime":{"type":"string","format":"date-time","description":"The approximate time when this ledger was closed. This number is rounded based on the `closeTimeResolution`. If it would have been rounded to the same time as a previous ledger, the close time is recorded as 1 second later instead."},"closeTimeResolution":{"type":"integer","minimum":1,"description":"A number of seconds, indicating how much the `closeTime` could be rounded. Ledger close times are approximate so that small differences in servers clocks don\'t hinder consensus."},"closeFlags":{"type":"integer","minimum":0,"description":"A bit-map of flags relating to the closing of this ledger. Currently, the ledger has only one flag defined for `closeFlags`: **sLCF_NoConsensusTime** (value 1). If this flag is enabled, it means that validators disagreed on the correct close time for the ledger, but built otherwise the same ledger, so they declared consensus while \\"agreeing to disagree\\" on the close time. In this case, the consensus ledger contains a `closeTime` value that is 1 second after that of the previous ledger. (In this case, there is no official close time, but the actual real-world close time is probably 3-6 seconds later than the specified `closeTime`.)"},"ledgerHash":{"$ref":"hash256","description":"Unique identifying hash of the entire ledger."},"ledgerVersion":{"$ref":"ledgerVersion","description":"The ledger version of this ledger."},"parentLedgerHash":{"$ref":"hash256","description":"Unique identifying hash of the ledger that came immediately before this one."},"parentCloseTime":{"type":"string","format":"date-time","description":"The previous ledger\'s recorded close time."},"totalDrops":{"$ref":"value","description":"Total number of drops (1/1,000,000th of an XRP) in the network, as a quoted integer. (This decreases as transaction fees cause XRP to be destroyed.)"},"transactionHash":{"$ref":"hash256","description":"Hash of the transaction information included in this ledger."},"transactions":{"description":"Array of all transactions that were validated in this ledger. Transactions are represented in the same format as the return value of [getTransaction](#gettransaction).","type":"array","items":{"$ref":"getTransaction","description":"A transaction in the same format as the return value of [getTransaction](#gettransaction)."}},"transactionHashes":{"description":"An array of hashes of all transactions that were validated in this ledger.","type":"array","items":{"$ref":"transactionHash"}},"rawState":{"type":"string","description":"A JSON string containing all state data for this ledger in rippled JSON format."},"stateHashes":{"description":"An array of hashes of all state data in this ledger.","type":"array","items":{"$ref":"hash256"}}},"required":["stateHash","closeTime","closeTimeResolution","closeFlags","ledgerHash","ledgerVersion","parentLedgerHash","parentCloseTime","totalDrops","transactionHash"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-orderbook.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getOrderbook","type":"object","properties":{"bids":{"$ref":"orderbookOrders","description":"The buy orders in the order book."},"asks":{"$ref":"orderbookOrders","description":"The sell orders in the order book."}},"required":["bids","asks"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-orders.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getOrders","type":"array","items":{"type":"object","properties":{"specification":{"$ref":"order","description":"An order specification that would create an order equivalent to the current state of this order."},"properties":{"description":"Properties of the order not in the specification.","type":"object","properties":{"maker":{"$ref":"address","description":"The address of the account that submitted the order."},"sequence":{"$ref":"sequence","description":"The account sequence number of the transaction that created this order."},"makerExchangeRate":{"$ref":"value","description":"The exchange rate from the point of view of the account that submitted the order (also known as \\"quality\\")."}},"required":["maker","sequence","makerExchangeRate"],"addtionalProperties":false}},"required":["specification","properties"],"additionalProperties":false}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-paths.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getPaths","type":"array","items":{"type":"object","properties":{"source":{"$ref":"sourceAdjustment","description":"Properties of the source of the payment."},"destination":{"$ref":"destinationAdjustment","description":"Properties of the destination of the payment."},"paths":{"type":"string","description":"The paths of trustlines and orders to use in executing the payment."}},"required":["source","destination","paths"],"additionalProperties":false}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-payment-channel.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getPaymentChannel","type":"object","properties":{"account":{"$ref":"address","description":"Address that created the payment channel."},"destination":{"$ref":"address","description":"Address to receive XRP claims against this channel."},"amount":{"$ref":"value","description":"The total amount of XRP funded in this channel."},"balance":{"$ref":"value","description":"The total amount of XRP delivered by this channel."},"settleDelay":{"type":"number","description":"Amount of seconds the source address must wait before closing the channel if it has unclaimed XRP."},"expiration":{"type":"string","format":"date-time","description":"Time when this channel expires."},"publicKey":{"$ref":"publicKey","description":"Public key of the key pair the source uses to sign claims against this channel."},"cancelAfter":{"type":"string","format":"date-time","description":"Time when this channel expires as specified at creation."},"sourceTag":{"$ref":"tag","description":"Source tag."},"destinationTag":{"$ref":"tag","description":"Destination tag."},"previousAffectingTransactionID":{"$ref":"hash256","description":"Hash value representing the most recent transaction that affected this payment channel."},"previousAffectingTransactionLedgerVersion":{"$ref":"ledgerVersion","description":"The ledger version that the transaction identified by the `previousAffectingTransactionID` was validated in."}},"required":["account","destination","amount","balance","settleDelay","previousAffectingTransactionID","previousAffectingTransactionLedgerVersion"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-server-info.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getServerInfo","type":"object","properties":{"buildVersion":{"type":"string","description":"The version number of the running rippled version."},"completeLedgers":{"type":"string","pattern":"[0-9,-]+","description":"Range expression indicating the sequence numbers of the ledger versions the local rippled has in its database. It is possible to be a disjoint sequence, e.g. “2500-5000,32570-7695432”."},"hostID":{"type":"string","description":"On an admin request, returns the hostname of the server running the rippled instance; otherwise, returns a unique four letter word."},"ioLatencyMs":{"type":"number","description":"Amount of time spent waiting for I/O operations, in milliseconds. If this number is not very, very low, then the rippled server is probably having serious load issues."},"load":{"type":"object","description":"*(Admin only)* Detailed information about the current load state of the server.","properties":{"jobTypes":{"type":"array","description":"*(Admin only)* Information about the rate of different types of jobs the server is doing and how much time it spends on each.","items":{"type":"object"}},"threads":{"type":"number","description":"*(Admin only)* The number of threads in the server’s main job pool, performing various operations."}},"required":["jobTypes","threads"]},"lastClose":{"type":"object","description":"Information about the last time the server closed a ledger.","properties":{"convergeTimeS":{"type":"number","description":"The time it took to reach a consensus for the last ledger closing, in seconds."},"proposers":{"type":"integer","minimum":0,"description":"Number of trusted validators participating in the ledger closing."}},"required":["convergeTimeS","proposers"]},"loadFactor":{"type":"number","description":"The load factor the server is currently enforcing, as a multiplier on the base transaction fee. The load factor is determined by the highest of the individual server’s load factor, cluster’s load factor, and the overall network’s load factor."},"peers":{"type":"integer","minimum":0,"description":"How many other rippled servers the node is currently connected to."},"pubkeyNode":{"type":"string","description":"Public key used to verify this node for internal communications; this key is automatically generated by the server the first time it starts up."},"pubkeyValidator":{"type":"string","description":"*(Admin only)* Public key used by this node to sign ledger validations."},"serverState":{"type":"string","description":"A string indicating to what extent the server is participating in the network. See [Possible Server States](https://xrpl.org/rippled-server-states.html) for more details.","enum":["disconnected","connected","syncing","tracking","full","validating","proposing"]},"validatedLedger":{"type":"object","description":"Information about the fully-validated ledger with the highest sequence number (the most recent).","properties":{"age":{"type":"integer","minimum":0,"description":"The time since the ledger was closed, in seconds."},"baseFeeXRP":{"$ref":"value","description":"Base fee, in XRP. This may be represented in scientific notation such as 1e-05 for 0.00005."},"hash":{"$ref":"hash256","description":"Unique hash for the ledger, as an uppercase hexadecimal string."},"reserveBaseXRP":{"$ref":"value","description":"Minimum amount of XRP necessary for every account to keep in reserve."},"reserveIncrementXRP":{"$ref":"value","description":"Amount of XRP added to the account reserve for each object an account owns in the ledger."},"ledgerVersion":{"type":"integer","minimum":0,"description":"Identifying ledger index of this ledger version."}},"additionalProperties":false,"required":["age","baseFeeXRP","hash","reserveBaseXRP","reserveIncrementXRP","ledgerVersion"]},"validationQuorum":{"type":"number","description":"Minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations."}},"required":["buildVersion","completeLedgers","hostID","ioLatencyMs","lastClose","loadFactor","peers","pubkeyNode","serverState","validatedLedger","validationQuorum"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-settings.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getSettings","$ref":"settingsPlusMemos","not":{"required":["memos"]}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-transaction.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getTransaction","description":"getTransaction response","link":"gettransaction","properties":{"type":{"$ref":"transactionType"},"specification":{"description":"A specification that would produce the same outcome as this transaction. *Exception:* For payment transactions, this omits the `destination.amount` field, to prevent misunderstanding. The structure of the specification depends on the value of the `type` field (see [Transaction Types](#transaction-types) for details). *Note:* This is **not** necessarily the same as the original specification."},"outcome":{"$ref":"outcome","description":"The outcome of the transaction (what effects it had)."},"id":{"$ref":"transactionHash","description":"A hash of the transaction that can be used to identify it."},"address":{"$ref":"address","description":"The address of the account that initiated the transaction."},"sequence":{"$ref":"sequence","description":"The account sequence number of the transaction for the account that initiated it."},"rawTransaction":{"description":"The raw transaction data as a JSON string. For advanced users only; exercise caution when interpreting this data.","type":"string"}},"required":["id","address","sequence","type","specification","outcome"],"additionalProperties":false,"oneOf":[{"properties":{"type":{"enum":["payment"]},"specification":{"$ref":"getPayment"}}},{"properties":{"type":{"enum":["order"]},"specification":{"$ref":"order"}}},{"properties":{"type":{"enum":["orderCancellation"]},"specification":{"$ref":"orderCancellation"}}},{"properties":{"type":{"enum":["trustline"]},"specification":{"$ref":"trustline"}}},{"properties":{"type":{"enum":["settings"]},"specification":{"$ref":"getSettings"}}},{"properties":{"type":{"enum":["checkCreate"]},"specification":{"$ref":"checkCreate"}}},{"properties":{"type":{"enum":["checkCancel"]},"specification":{"$ref":"checkCancel"}}},{"properties":{"type":{"enum":["checkCash"]},"specification":{"$ref":"checkCash"}}},{"properties":{"type":{"enum":["escrowCreation"]},"specification":{"$ref":"escrowCreation"}}},{"properties":{"type":{"enum":["escrowCancellation"]},"specification":{"$ref":"escrowCancellation"}}},{"properties":{"type":{"enum":["escrowExecution"]},"specification":{"$ref":"escrowExecution"}}},{"properties":{"type":{"enum":["paymentChannelCreate"]},"specification":{"$ref":"paymentChannelCreate"}}},{"properties":{"type":{"enum":["paymentChannelFund"]},"specification":{"$ref":"paymentChannelFund"}}},{"properties":{"type":{"enum":["paymentChannelClaim"]},"specification":{"$ref":"paymentChannelClaim"}}},{"properties":{"type":{"enum":["depositPreauth"]},"specification":{"$ref":"depositPreauth"}}},{"properties":{"type":{"enum":["accountDelete"]},"specification":{"$ref":"accountDelete"}}}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-transactions.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getTransactions","type":"array","items":{"$ref":"getTransaction"}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/get-trustlines.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getTrustlines","type":"array","items":{"properties":{"specification":{"$ref":"trustline","description":"A trust line specification that would produce this trust line in its current state."},"counterparty":{"properties":{"limit":{"$ref":"value","description":"The maximum amount that the counterparty can be owed through the trust line."},"ripplingDisabled":{"type":"boolean","description":"If true, payments cannot ripple through this trustline."},"frozen":{"type":"boolean","description":"If true, the trust line is frozen, which means that funds can only be sent directly to the counterparty."},"authorized":{"type":"boolean","description":"If true, the counterparty authorizes this party to hold issuances from the counterparty."}},"description":"Properties of the trustline from the perspective of the counterparty.","required":["limit"],"additionalProperties":false},"state":{"properties":{"balance":{"$ref":"signedValue","description":"The balance on the trust line, representing which party owes the other and by how much."}},"description":"Non-settings details of the trust line\'s state.","required":["balance"],"additionalProperties":false}},"required":["specification","counterparty","state"],"additionalProperties":false}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/ledger-event.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"ledgerEvent","description":"A ledger event message","type":"object","properties":{"baseFeeXRP":{"$ref":"value","description":"Base fee, in XRP."},"ledgerHash":{"$ref":"hash256","description":"Unique hash of the ledger that was closed, as hex."},"ledgerVersion":{"$ref":"ledgerVersion","description":"Ledger version of the ledger that closed."},"ledgerTimestamp":{"type":"string","format":"date-time","description":"The time at which this ledger closed."},"reserveBaseXRP":{"$ref":"value","description":"The minimum reserve, in XRP, that is required for an account."},"reserveIncrementXRP":{"$ref":"value","description":"The increase in account reserve that is added for each item the account owns, such as offers or trust lines."},"transactionCount":{"type":"integer","minimum":0,"description":"Number of new transactions included in this ledger."},"validatedLedgerVersions":{"type":"string","description":"Range of ledgers that the server has available. This may be discontiguous."}},"addtionalProperties":false,"required":["baseFeeXRP","ledgerHash","ledgerTimestamp","reserveBaseXRP","reserveIncrementXRP","transactionCount","ledgerVersion","validatedLedgerVersions"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/order-change.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"orderChange","type":"object","description":"A change to an order.","properties":{"direction":{"type":"string","enum":["buy","sell"],"description":"Equal to \\"buy\\" for buy orders and \\"sell\\" for sell orders."},"quantity":{"$ref":"amount","description":"The amount to be bought or sold by the maker."},"totalPrice":{"$ref":"amount","description":"The total amount to be paid or received by the taker."},"makerExchangeRate":{"$ref":"value","description":"The exchange rate between the `quantity` currency and the `totalPrice` currency from the point of view of the maker."},"sequence":{"$ref":"sequence","description":"The order sequence number, used to identify the order for cancellation"},"status":{"enum":["created","filled","partially-filled","cancelled"],"description":"The status of the order. One of \\"created\\", \\"filled\\", \\"partially-filled\\", \\"cancelled\\"."},"expirationTime":{"type":"string","format":"date-time","description":"The time after which the order expires, if any."}},"required":["direction","quantity","totalPrice","sequence","status"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/orderbook-orders.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"orderbookOrders","type":"array","items":{"description":"An order in the order book.","type":"object","properties":{"specification":{"$ref":"order","description":"An order specification that would create an order equivalent to the current state of this order."},"properties":{"description":"Properties of the order not in the specification.","type":"object","properties":{"maker":{"$ref":"address","description":"The address of the account that submitted the order."},"sequence":{"$ref":"sequence","description":"The account sequence number of the transaction that created this order."},"makerExchangeRate":{"$ref":"value","description":"The exchange rate from the point of view of the account that submitted the order (also known as \\"quality\\")."}},"required":["maker","sequence","makerExchangeRate"],"addtionalProperties":false},"state":{"description":"The state of the order.","type":"object","properties":{"fundedAmount":{"$ref":"amount","description":"How much of the amount the maker would have to pay that the maker currently holds."},"priceOfFundedAmount":{"$ref":"amount","description":"How much the `fundedAmount` would convert to through the exchange rate of this order."}},"required":["fundedAmount","priceOfFundedAmount"],"additionalProperties":false},"data":{"description":"The raw order data. This may include `owner_funds`, `Flags`, and other fields.","type":"object","additionalProperties":true}},"required":["specification","properties","data"],"additionalProperties":false}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/outcome.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"outcome","type":"object","description":"The outcome of the transaction (what effects it had).","properties":{"result":{"type":"string","description":"Result code returned by rippled. See [Transaction Results](https://xrpl.org/transaction-results.html) for a complete list."},"timestamp":{"type":"string","format":"date-time","description":"The timestamp when the transaction was validated. (May be missing when requesting transactions in binary mode.)"},"fee":{"$ref":"value","description":"The XRP fee that was charged for the transaction."},"deliveredAmount":{"$ref":"amount","description":"For payment transactions, it is impossible to reliably compute the actual delivered amount from the balanceChanges due to fixed precision. If the payment is not a partial payment and the transaction succeeded, the deliveredAmount should always be considered to be the amount specified in the transaction."},"balanceChanges":{"type":"object","additionalProperties":{"type":"array","description":"Key is the XRP Ledger address; value is an array of signed amounts representing changes of balances for that address.","items":{"$ref":"balance"}}},"orderbookChanges":{"type":"object","additionalProperties":{"type":"array","description":"Key is the maker\'s XRP Ledger address; value is an array of changes","items":{"$ref":"orderChange"}}},"channelChanges":{"type":"object","description":"Properties reflecting the details of the payment channel."},"ledgerVersion":{"$ref":"ledgerVersion","description":"The ledger version that the transaction was validated in."},"indexInLedger":{"type":"integer","minimum":0,"description":"The ordering index of the transaction in the ledger."}},"required":["result","fee","balanceChanges","orderbookChanges","ledgerVersion","indexInLedger"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/prepare.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"prepare","description":"Result of prepare function","type":"object","properties":{"txJSON":{"type":"string","description":"The prepared transaction in rippled JSON format."},"instructions":{"description":"The instructions for how to execute the transaction after adding automatic defaults.","type":"object","properties":{"fee":{"$ref":"value","description":"The fee to pay for the transaction. See [Transaction Fees](#transaction-fees) for more information. For multi-signed transactions, this fee is multiplied by (N+1), where N is the number of signatures you plan to provide."},"sequence":{"$ref":"sequence","description":"The initiating account\'s sequence number for this transaction. `sequence` and `ticketSequence` are mutually exclusive, only one of them can be set."},"ticketSequence":{"$ref":"ticket-sequence","description":"The initiating account\'s ticket sequence number for this transaction. `sequence` and `ticketSequence` are mutually exclusive, only one of them can be set."},"maxLedgerVersion":{"oneOf":[{"$ref":"ledgerVersion"},{"type":"null"}],"description":"The highest ledger version that the transaction can be included in. Set to `null` if there is no maximum. If not null, this must be an integer greater than 0, or one of the following strings: \'validated\', \'closed\', \'current\'."}},"additionalProperties":false,"required":["fee","maxLedgerVersion"],"anyOf":[{"required":["sequence"]},{"required":["ticketSequence"]}]}},"additionalProperties":false,"required":["txJSON","instructions"]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/sign-payment-channel-claim.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"signPaymentChannelClaim","type":"string","$ref":"signature","additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/sign.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"sign","type":"object","properties":{"signedTransaction":{"type":"string","pattern":"^[A-F0-9]+$","description":"The signed transaction represented as an uppercase hexadecimal string."},"id":{"$ref":"transactionHash","description":"The [Transaction ID](#transaction-id) of the signed transaction."}},"required":["signedTransaction","id"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/submit.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"submit","type":"object","properties":{"resultCode":{"type":"string","description":"Deprecated: Use `engine_result` instead."},"resultMessage":{"type":"string","description":"Deprecated: Use `engine_result_message` instead."},"engine_result":{"type":"string","description":"Code indicating the preliminary result of the transaction, for example `tesSUCCESS`. [List of transaction responses](https://xrpl.org/transaction-results.html)"},"engine_result_code":{"type":"integer","description":"Numeric code indicating the preliminary result of the transaction, directly correlated to `engine_result`"},"engine_result_message":{"type":"string","description":"Human-readable explanation of the transaction\'s preliminary result."},"tx_blob":{"type":"string","description":"The complete transaction in hex string format."},"tx_json":{"$ref":"tx-json","description":"The complete transaction in JSON format."}},"required":["resultCode","resultMessage","engine_result","engine_result_code","engine_result_message","tx_blob","tx_json"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/output/verify-payment-channel-claim.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"verifyPaymentChannelClaim","type":"boolean","additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/account-delete.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"accountDelete","link":"account-delete","type":"object","properties":{"destination":{"$ref":"address","description":"Address of an account to receive any leftover XRP after deleting the sending account. Must be a funded account in the ledger, and must not be the sending account."},"destinationTag":{"$ref":"tag","description":"(Optional) Arbitrary destination tag that identifies a hosted recipient or other information for the recipient of the deleted account\'s leftover XRP."},"destinationXAddress":{"$ref":"address","description":"X-address of an account to receive any leftover XRP after deleting the sending account. Must be a funded account in the ledger, and must not be the sending account."},"memos":{"$ref":"memos"}},"anyOf":[{"required":["destination"]},{"required":["destinationXAddress"]}],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/check-cancel.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"checkCancel","link":"check-cancel","type":"object","properties":{"checkID":{"$ref":"hash256","description":"The ID of the Check ledger object to cancel, as a 64-character hexadecimal string."},"memos":{"$ref":"memos"}},"required":["checkID"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/check-cash.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"checkCash","link":"check-cash","type":"object","properties":{"checkID":{"$ref":"hash256","description":"The ID of the Check ledger object to cash, as a 64-character hexadecimal string."},"amount":{"$ref":"laxAmount","description":"Redeem the Check for exactly this amount, if possible. The currency must match that of the sendMax of the corresponding CheckCreate transaction. You must provide either this field or deliverMin."},"deliverMin":{"$ref":"laxAmount","description":"Redeem the Check for at least this amount and for as much as possible. The currency must match that of the sendMax of the corresponding CheckCreate transaction. You must provide either this field or amount."},"memos":{"$ref":"memos"}},"required":["checkID"],"oneOf":[{"required":["amount"]},{"required":["deliverMin"]}],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/check-create.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"checkCreate","link":"check-create","type":"object","properties":{"destination":{"$ref":"address","description":"Address of the account that can cash the check."},"sendMax":{"$ref":"laxAmount","description":"Amount of source currency the check is allowed to debit the sender, including transfer fees on non-XRP currencies."},"destinationTag":{"$ref":"tag","description":"Destination tag that identifies the reason for the check, or a hosted recipient to pay."},"expiration":{"type":"string","format":"date-time","description":"Time after which the check is no longer valid."},"invoiceID":{"$ref":"hash256","description":"256-bit hash, as a 64-character hexadecimal string, representing a specific reason or identifier for this check."},"memos":{"$ref":"memos"}},"required":["destination","sendMax"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/deposit-preauth.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"depositPreauth","link":"deposit-preauth","type":"object","properties":{"authorize":{"$ref":"address","description":"Address of the account that can cash the check."},"unauthorize":{"$ref":"address","description":"Address of the account that can cash the check."},"memos":{"$ref":"memos"}},"oneOf":[{"required":["authorize"]},{"required":["unauthorize"]}],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/escrow-cancellation.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"escrowCancellation","link":"escrow-cancellation","type":"object","properties":{"memos":{"$ref":"memos"},"owner":{"$ref":"address","description":"The address of the owner of the escrow to cancel."},"escrowSequence":{"$ref":"sequence","description":"The [account sequence number](#account-sequence-number) of the [Escrow Creation](#escrow-creation) transaction for the escrow to cancel."}},"required":["owner","escrowSequence"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/escrow-creation.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"escrowCreation","link":"escrow-creation","type":"object","properties":{"amount":{"$ref":"value","description":"Amount of XRP for sender to escrow."},"destination":{"$ref":"address","description":"Address to receive escrowed XRP."},"memos":{"$ref":"memos"},"condition":{"type":"string","description":"A hex value representing a [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1). If present, `fulfillment` is required upon execution.","pattern":"^[A-F0-9]{0,256}$"},"allowCancelAfter":{"type":"string","format":"date-time","description":"If present, the escrow may be cancelled after this time."},"allowExecuteAfter":{"type":"string","format":"date-time","description":"If present, the escrow can not be executed before this time."},"sourceTag":{"$ref":"tag","description":"Source tag."},"destinationTag":{"$ref":"tag","description":"Destination tag."}},"required":["amount","destination"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/escrow-execution.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"escrowExecution","link":"escrow-execution","type":"object","properties":{"memos":{"$ref":"memos"},"owner":{"$ref":"address","description":"The address of the owner of the escrow to execute."},"escrowSequence":{"$ref":"sequence","description":"The [account sequence number](#account-sequence-number) of the [Escrow Creation](#escrow-creation) transaction for the escrow to execute."},"condition":{"type":"string","description":"A hex value representing a [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1). This must match the original `condition` from the escrow creation transaction.","pattern":"^[A-F0-9]{0,256}$"},"fulfillment":{"type":"string","description":"A hex value representing the [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1) fulfillment for `condition`.","pattern":"^[A-F0-9]+$"}},"required":["owner","escrowSequence"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/get-payment.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"getPayment","description":"A specification of a payment in a response for getTransaction or getTransactions.","type":"object","properties":{"source":{"$ref":"sourceAdjustment","description":"The source of the funds to be sent."},"destination":{"$ref":"destinationAddressTag","description":"The destination of the funds to be sent. Since this is a payment response, the amount is not shown here. For the amount that the transaction delivered, see `outcome.deliveredAmount`."},"paths":{"type":"string","description":"The paths of trustlines and orders to use in executing the payment."},"memos":{"$ref":"memos"},"invoiceID":{"description":"A 256-bit hash that can be used to identify a particular payment.","$ref":"hash256"},"allowPartialPayment":{"description":"If true, this payment can deliver less than the full amount.","type":"boolean"},"noDirectRipple":{"description":"If true and paths are specified, the sender would like the XRP Ledger to disregard any direct paths from the source account to the destination account. This may be used to take advantage of an arbitrage opportunity or by gateways wishing to issue balances from a hot wallet to a user who has mistakenly set a trustline directly to the hot wallet.","type":"boolean"},"limitQuality":{"description":"Only take paths where all the conversions have an input:output ratio that is equal or better than the ratio of destination.amount:source.maxAmount.","type":"boolean"}},"required":["source","destination"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/order-cancellation.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"orderCancellation","link":"order-cancellation","type":"object","properties":{"orderSequence":{"$ref":"sequence","description":"The [account sequence number](#account-sequence-number) of the order to cancel."},"memos":{"$ref":"memos"}},"required":["orderSequence"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/order.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"order","link":"order","type":"object","properties":{"direction":{"type":"string","enum":["buy","sell"],"description":"Equal to \\"buy\\" for buy orders and \\"sell\\" for sell orders."},"quantity":{"$ref":"amount","description":"The amount of currency to buy or sell."},"totalPrice":{"$ref":"amount","description":"The total price to be paid for the `quantity` to be bought or sold."},"immediateOrCancel":{"type":"boolean","description":"Treat the offer as an [Immediate or Cancel order](http://en.wikipedia.org/wiki/Immediate_or_cancel). If enabled, do not create an object in the ledger that can be matched later: instead, only execute as much as can be fulfilled immediately. This cannot be used with `fillOrKill`."},"fillOrKill":{"type":"boolean","description":"Treat the offer as a [Fill or Kill order](http://en.wikipedia.org/wiki/Fill_or_kill). Only attempt to match existing offers in the ledger, and only do so if the entire quantity can be exchanged. This cannot be used with `immediateOrCancel`."},"passive":{"description":"If enabled, the offer does not consume offers that exactly match it, and instead becomes an Offer node in the ledger. It still consumes offers that cross it.","type":"boolean"},"expirationTime":{"type":"string","format":"date-time","description":"Time after which the offer is no longer active, as an [ISO 8601 date-time](https://en.wikipedia.org/wiki/ISO_8601)."},"orderToReplace":{"$ref":"sequence","description":"The [account sequence number](#account-sequence-number) of an order to cancel before the new order is created, effectively replacing the old order."},"memos":{"$ref":"memos"}},"required":["direction","quantity","totalPrice"],"additionalProperties":false,"not":{"description":"immediateOrCancel and fillOrKill are mutually exclusive","required":["immediateOrCancel","fillOrKill"]}}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/payment-channel-claim.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"paymentChannelClaim","link":"payment-channel-claim","type":"object","properties":{"channel":{"$ref":"hash256","description":"256-bit hexadecimal channel identifier."},"amount":{"$ref":"value","description":"Amount of XRP authorized by this signature."},"balance":{"$ref":"value","description":"Total XRP balance delivered by this channel after claim is processed."},"signature":{"$ref":"signature","description":"Signed claim authorizing withdrawal of XRP from the channel. (Required except from the channel\'s source address.)"},"publicKey":{"$ref":"publicKey","description":"Public key of the channel. (For verifying the signature.)"},"renew":{"type":"boolean","description":"Clear the channel\'s expiration time."},"close":{"type":"boolean","description":"Request to close the channel. If the channel has no XRP remaining or the destination address requests it, closes the channel immediately (returning unclaimed XRP to the source address). Otherwise, sets the channel to expire after settleDelay seconds have passed."},"memos":{"$ref":"memos"}},"required":["channel"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/payment-channel-create.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"paymentChannelCreate","link":"payment-channel-create","type":"object","properties":{"amount":{"$ref":"value","description":"Amount of XRP for sender to set aside in this channel."},"destination":{"$ref":"address","description":"Address to receive XRP claims against this channel."},"settleDelay":{"type":"number","description":"Amount of seconds the source address must wait before closing the channel if it has unclaimed XRP."},"publicKey":{"$ref":"publicKey","description":"Public key of the key pair the source may use to sign claims against this channel."},"cancelAfter":{"type":"string","format":"date-time","description":"Time when this channel expires. This expiration cannot be changed after creating the channel."},"sourceTag":{"$ref":"tag","description":"Source tag."},"destinationTag":{"$ref":"tag","description":"Destination tag."},"memos":{"$ref":"memos"}},"required":["amount","destination","settleDelay","publicKey"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/payment-channel-fund.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"paymentChannelFund","link":"payment-channel-fund","type":"object","properties":{"amount":{"$ref":"value","description":"Amount of XRP to fund the channel with."},"channel":{"$ref":"hash256","description":"256-bit hexadecimal channel identifier."},"expiration":{"type":"string","format":"date-time","description":"New expiration for this channel. (This does not change the cancelAfter expiration, if the channel has one.) Cannot move the expiration sooner than settleDelay seconds from time of the request."},"memos":{"$ref":"memos"}},"required":["amount","channel"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/payment.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"payment","link":"payment","type":"object","properties":{"source":{"$ref":"sourceAdjustment","description":"The source of the funds to be sent."},"destination":{"$ref":"destinationAdjustment","description":"The destination of the funds to be sent."},"paths":{"type":"string","description":"The paths of trustlines and orders to use in executing the payment."},"memos":{"$ref":"memos"},"invoiceID":{"description":"A 256-bit hash that can be used to identify a particular payment.","$ref":"hash256"},"allowPartialPayment":{"description":"If true, this payment can deliver less than the full amount.","type":"boolean"},"noDirectRipple":{"description":"If true and paths are specified, the sender would like the XRP Ledger to disregard any direct paths from the source account to the destination account. This may be used to take advantage of an arbitrage opportunity or by gateways wishing to issue balances from a hot wallet to a user who has mistakenly set a trustline directly to the hot wallet.","type":"boolean"},"limitQuality":{"description":"Only take paths where all the conversions have an input:output ratio that is equal or better than the ratio of destination.amount:source.maxAmount.","type":"boolean"}},"required":["source","destination"],"additionalProperties":false}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/settings.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"settings","link":"settings","$ref":"settingsPlusMemos","oneOf":[{"required":["memos"],"minProperties":2,"maxProperties":2},{"not":{"required":["memos"]},"minProperties":1,"maxProperties":1}]}')},"../../node_modules/ripple-lib/dist/npm/common/schemas/specifications/trustline.json":e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"trustline","link":"trustline","type":"object","properties":{"currency":{"$ref":"currency","description":"The currency this trustline applies to."},"counterparty":{"$ref":"address","description":"The address of the account this trustline extends trust to."},"limit":{"$ref":"value","description":"The maximum amount that the owner of the trustline can be owed through the trustline."},"qualityIn":{"$ref":"quality","description":"Incoming balances on this trustline are valued at this ratio."},"qualityOut":{"$ref":"quality","description":"Outgoing balances on this trustline are valued at this ratio."},"ripplingDisabled":{"type":"boolean","description":"If true, payments cannot ripple through this trustline."},"authorized":{"type":"boolean","description":"If true, authorize the counterparty to hold issuances from this account."},"frozen":{"type":"boolean","description":"If true, the trustline is frozen, which means that funds can only be sent to the owner."},"memos":{"$ref":"memos"}},"required":["currency","counterparty","limit"],"additionalProperties":false}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);r("../blockchain-link/lib/workers/ripple/index.js")})(); \ No newline at end of file diff --git a/app/trezor-prebuild/build/workers/sessions-background-sharedworker.f94223d1a920641f41b9.js b/app/trezor-prebuild/build/workers/sessions-background-sharedworker.f94223d1a920641f41b9.js new file mode 100644 index 0000000000..e4f3bf5c71 --- /dev/null +++ b/app/trezor-prebuild/build/workers/sessions-background-sharedworker.f94223d1a920641f41b9.js @@ -0,0 +1,17 @@ +(()=>{var t={"../transport/lib/errors.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ABORTED_BY_TIMEOUT=e.ABORTED_BY_SIGNAL=e.UNEXPECTED_ERROR=e.HTTP_ERROR=e.OTHER_CALL_IN_PROGRESS=e.DEVICE_DISCONNECTED_DURING_ACTION=e.WRONG_ENVIRONMENT=e.WRONG_RESULT_TYPE=e.NATIVE_INTERFACE_NOT_AVAILABLE=e.ALREADY_LISTENING=e.SESSION_BACKGROUND_TIMEOUT=e.SESSION_NOT_FOUND=e.SESSION_WRONG_PREVIOUS=e.DEVICE_UNREADABLE=e.DEVICE_NOT_FOUND=e.INTERFACE_DATA_TRANSFER=e.INTERFACE_UNABLE_TO_CLOSE_DEVICE=e.INTERFACE_UNABLE_TO_OPEN_DEVICE=void 0,e.INTERFACE_UNABLE_TO_OPEN_DEVICE="Unable to open device",e.INTERFACE_UNABLE_TO_CLOSE_DEVICE="Unable to close device",e.INTERFACE_DATA_TRANSFER="A transfer error has occurred.",e.DEVICE_NOT_FOUND="device not found",e.DEVICE_UNREADABLE="Device unreadable",e.SESSION_WRONG_PREVIOUS="wrong previous session",e.SESSION_NOT_FOUND="session not found",e.SESSION_BACKGROUND_TIMEOUT="sessions background did not respond",e.ALREADY_LISTENING="already listening",e.NATIVE_INTERFACE_NOT_AVAILABLE="interface not available",e.WRONG_RESULT_TYPE="Wrong result type.",e.WRONG_ENVIRONMENT="This transport can not be used in this environment",e.DEVICE_DISCONNECTED_DURING_ACTION="device disconnected during action",e.OTHER_CALL_IN_PROGRESS="other call in progress",e.HTTP_ERROR="Network request failed",e.UNEXPECTED_ERROR="unexpected error",e.ABORTED_BY_SIGNAL="Aborted by signal",e.ABORTED_BY_TIMEOUT="Aborted by timeout"},"../transport/lib/sessions/background.js":function(t,e,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e},u=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=n))((function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.SessionsBackground=void 0;const a=r("../utils/lib/index.js"),c=r("../utils/lib/typedEventEmitter.js"),l=s(r("../transport/lib/errors.js"));class f extends c.TypedEmitter{constructor(){super(...arguments),this.sessions={},this.locksQueue=[],this.locksTimeoutQueue=[],this.lastSession=0}handleMessage(t){return u(this,void 0,void 0,(function*(){let e;try{switch(t.type){case"handshake":e=this.handshake();break;case"enumerateIntent":e=yield this.enumerateIntent();break;case"enumerateDone":e=yield this.enumerateDone(t.payload);break;case"acquireIntent":e=yield this.acquireIntent(t.payload);break;case"acquireDone":e=yield this.acquireDone(t.payload);break;case"getSessions":e=yield this.getSessions();break;case"releaseIntent":e=yield this.releaseIntent(t.payload);break;case"releaseDone":e=yield this.releaseDone(t.payload);break;case"getPathBySession":e=this.getPathBySession(t.payload);break;default:throw new Error(l.UNEXPECTED_ERROR)}return Object.assign(Object.assign({},e),{id:t.id})}catch(e){return Object.assign(Object.assign({},this.error(l.UNEXPECTED_ERROR)),{id:t.type})}finally{if(e&&e.success&&e.payload&&"descriptors"in e.payload){const{descriptors:t}=e.payload;setTimeout((()=>this.emit("descriptors",t)),0)}}}))}handshake(){return this.success(void 0)}enumerateIntent(){return u(this,void 0,void 0,(function*(){return yield this.waitInQueue(),this.success({sessions:this.sessions})}))}enumerateDone(t){this.clearLock();this.filterDisconnectedDevices(this.sessionsToDescriptors(),t.paths).forEach((t=>{delete this.sessions[t.path]})),t.paths.forEach((t=>{this.sessions[t]||(this.sessions[t]=null)}));const e=this.sessionsToDescriptors();return n.resolve(this.success({sessions:this.sessions,descriptors:e}))}acquireIntent(t){return u(this,void 0,void 0,(function*(){const e=this.sessions[t.path];if(t.previous&&t.previous!==e)return this.error(l.SESSION_WRONG_PREVIOUS);if(yield this.waitInQueue(),e!==this.sessions[t.path])return this.clearLock(),this.error(l.SESSION_WRONG_PREVIOUS);const r=JSON.parse(JSON.stringify(this.sessions)),n=`${this.getNewSessionId()}`;r[t.path]=n;const i=this.sessionsToDescriptors(r);return this.success({session:n,descriptors:i})}))}acquireDone(t){this.clearLock(),this.sessions[t.path]=`${this.lastSession}`;const e=this.sessionsToDescriptors();return n.resolve(this.success({descriptors:e}))}releaseIntent(t){return u(this,void 0,void 0,(function*(){const e=this._getPathBySession({session:t.session});return e?(yield this.waitInQueue(),this.success({path:e})):this.error(l.SESSION_NOT_FOUND)}))}releaseDone(t){this.sessions[t.path]=null,this.clearLock();const e=this.sessionsToDescriptors();return n.resolve(this.success({descriptors:e}))}getSessions(){return n.resolve(this.success({sessions:this.sessions}))}getPathBySession({session:t}){const e=this._getPathBySession({session:t});return e?this.success({path:e}):this.error(l.SESSION_NOT_FOUND)}_getPathBySession({session:t}){let e;return Object.keys(this.sessions).forEach((r=>{this.sessions[r]===t&&(e=r)})),e}startLock(){const t=(0,a.createDeferred)(),e=setTimeout((()=>{t.resolve(void 0)}),4e3);return this.locksQueue.push(t),this.locksTimeoutQueue.push(e),this.locksQueue.length-1}clearLock(){this.locksQueue[0]?(this.locksQueue[0].resolve(void 0),this.locksQueue.shift(),clearTimeout(this.locksTimeoutQueue[0]),this.locksTimeoutQueue.shift()):console.warn("empty lock queue")}waitForUnlocked(t){return u(this,void 0,void 0,(function*(){if(t>0){const e=this.locksQueue.slice(0,t);e.length&&(yield n.all(e.map((t=>t.promise))))}}))}waitInQueue(){return u(this,void 0,void 0,(function*(){const t=this.startLock();yield this.waitForUnlocked(t)}))}getNewSessionId(){return this.lastSession++,this.lastSession}sessionsToDescriptors(t){return Object.entries(t||this.sessions).map((t=>({path:t[0],session:t[1]})))}filterDisconnectedDevices(t,e){return t.filter((t=>!e.find((e=>t.path===e))))}success(t){return{success:!0,payload:t}}error(t){return{success:!1,error:t}}}e.SessionsBackground=f},"../utils/lib/arrayDistinct.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayDistinct=void 0;e.arrayDistinct=(t,e,r)=>r.indexOf(t)===e},"../utils/lib/arrayPartition.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayPartition=void 0;e.arrayPartition=(t,e)=>t.reduce((([t,r],n)=>e(n)?[[...t,n],r]:[t,[...r,n]]),[[],[]])},"../utils/lib/arrayShuffle.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayShuffle=void 0;e.arrayShuffle=t=>{const e=t.slice();for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}return e}},"../utils/lib/arrayToDictionary.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayToDictionary=void 0;const r=t=>!!["string","number"].includes(typeof t);e.arrayToDictionary=(t,e,n)=>n?t.reduce(((t,n)=>{var i;const o=e(n);return r(o)?Object.assign(Object.assign({},t),{[o]:[...null!==(i=t[o])&&void 0!==i?i:[],n]}):t}),{}):t.reduce(((t,n)=>{const i=e(n);return r(i)?Object.assign(Object.assign({},t),{[i]:n}):t}),{})},"../utils/lib/bufferUtils.js":(t,e,r)=>{"use strict";var Buffer=r("../../node_modules/buffer/index.js").lW;Object.defineProperty(e,"__esModule",{value:!0}),e.getChunkSize=e.reverseBuffer=void 0;e.reverseBuffer=t=>{if(t.length<1)return t;const e=Buffer.alloc(t.length);let r=e.length-1;for(let n=0;n{const e=Buffer.allocUnsafe(1);return e.writeUInt8(t),e}},"../utils/lib/bytesToHumanReadable.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bytesToHumanReadable=void 0;const r=["B","KB","MB","GB","TB"];e.bytesToHumanReadable=t=>{let e=Math.abs(t),n=0;for(;e>=1024||n>=r.length;)e/=1024,n++;return`${e.toFixed(1)} ${r[n]}`}},"../utils/lib/capitalizeFirstLetter.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.capitalizeFirstLetter=void 0;e.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1)},"../utils/lib/cloneObject.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cloneObject=void 0;e.cloneObject=t=>{const e=JSON.stringify(t);return void 0===e?t:JSON.parse(e)}},"../utils/lib/countBytesInString.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.countBytesInString=void 0;e.countBytesInString=t=>encodeURI(t).split(/%..|./).length-1},"../utils/lib/createCooldown.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createCooldown=void 0;e.createCooldown=t=>{let e=0;return()=>{const r=Date.now();return r-e>=t&&(e=r,!0)}}},"../utils/lib/createDeferred.js":(t,e,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(e,"__esModule",{value:!0}),e.createDeferred=void 0;e.createDeferred=t=>{let e=()=>{},r=()=>{};const i=new n(((t,n)=>{e=t,r=n}));return{id:t,resolve:e,reject:r,promise:i}}},"../utils/lib/createTimeoutPromise.js":(t,e,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(e,"__esModule",{value:!0}),e.createTimeoutPromise=void 0;e.createTimeoutPromise=t=>new n((e=>setTimeout(e,t)))},"../utils/lib/enumUtils.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getValueByKey=e.getKeyByValue=void 0,e.getKeyByValue=function(t,e){return t&&Object.keys(t).find((r=>t[r]===e))},e.getValueByKey=function(t,e){const r=t&&Object.keys(t).find((t=>t===e));return r&&t[r]}},"../utils/lib/getLocaleSeparators.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLocaleSeparators=void 0;e.getLocaleSeparators=t=>{var e,r;const n=new Intl.NumberFormat(t).formatToParts(10000.1);return{decimalSeparator:null===(e=n.find((({type:t})=>"decimal"===t)))||void 0===e?void 0:e.value,thousandsSeparator:null===(r=n.find((({type:t})=>"group"===t)))||void 0===r?void 0:r.value}}},"../utils/lib/getNumberFromPixelString.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getNumberFromPixelString=void 0;e.getNumberFromPixelString=t=>parseInt(t.replace("px",""),10)},"../utils/lib/getRandomNumberInRange.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRandomNumberInRange=void 0;e.getRandomNumberInRange=(t,e)=>Math.floor(Math.random()*(e-t+1))+t},"../utils/lib/getSynchronize.js":(t,e,r)=>{"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise;Object.defineProperty(e,"__esModule",{value:!0}),e.getSynchronize=void 0;e.getSynchronize=()=>{let t;return e=>{const r=(null!=t?t:n.resolve()).catch((()=>{})).then(e).finally((()=>{t===r&&(t=void 0)}));return t=r,t}}},"../utils/lib/getWeakRandomId.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getWeakRandomId=void 0;e.getWeakRandomId=t=>{let e="";const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasUppercaseLetter=void 0;const r=new RegExp("^(.*[A-Z].*)$");e.hasUppercaseLetter=t=>r.test(t)},"../utils/lib/index.js":function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.xssFilters=e.versionUtils=e.enumUtils=e.bufferUtils=void 0,o(r("../utils/lib/arrayDistinct.js"),e),o(r("../utils/lib/arrayPartition.js"),e),o(r("../utils/lib/arrayShuffle.js"),e),o(r("../utils/lib/arrayToDictionary.js"),e),e.bufferUtils=s(r("../utils/lib/bufferUtils.js")),o(r("../utils/lib/bytesToHumanReadable.js"),e),o(r("../utils/lib/capitalizeFirstLetter.js"),e),o(r("../utils/lib/cloneObject.js"),e),o(r("../utils/lib/countBytesInString.js"),e),o(r("../utils/lib/createCooldown.js"),e),o(r("../utils/lib/createDeferred.js"),e),o(r("../utils/lib/createTimeoutPromise.js"),e),e.enumUtils=s(r("../utils/lib/enumUtils.js")),o(r("../utils/lib/getNumberFromPixelString.js"),e),o(r("../utils/lib/getRandomNumberInRange.js"),e),o(r("../utils/lib/getSynchronize.js"),e),o(r("../utils/lib/getWeakRandomId.js"),e),o(r("../utils/lib/hasUppercaseLetter.js"),e),o(r("../utils/lib/isAscii.js"),e),o(r("../utils/lib/isHex.js"),e),o(r("../utils/lib/isNotUndefined.js"),e),o(r("../utils/lib/isUrl.js"),e),o(r("../utils/lib/mergeDeepObject.js"),e),o(r("../utils/lib/objectPartition.js"),e),o(r("../utils/lib/parseElectrumUrl.js"),e),o(r("../utils/lib/parseHostname.js"),e),o(r("../utils/lib/promiseAllSequence.js"),e),o(r("../utils/lib/redactUserPath.js"),e),o(r("../utils/lib/scheduleAction.js"),e),o(r("../utils/lib/throwError.js"),e),o(r("../utils/lib/truncateMiddle.js"),e),o(r("../utils/lib/topologicalSort.js"),e),o(r("../utils/lib/urlToOnion.js"),e),e.versionUtils=s(r("../utils/lib/versionUtils.js")),e.xssFilters=s(r("../utils/lib/xssFilters.js")),o(r("../utils/lib/getLocaleSeparators.js"),e)},"../utils/lib/isAscii.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAscii=void 0,e.isAscii=function(t){return!t||/^[\x00-\x7F]*$/.test(t)}},"../utils/lib/isHex.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isHex=void 0;e.isHex=t=>/^(0x|0X)?[0-9A-Fa-f]+$/g.test(t)},"../utils/lib/isNotUndefined.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isNotUndefined=void 0;e.isNotUndefined=t=>void 0!==t},"../utils/lib/isUrl.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isUrl=void 0;const r=/^(http|ws)s?:\/\/[a-z0-9]([a-z0-9.-]+)?(:[0-9]{1,5})?((\/)?(([a-z0-9-_])+(\/)?)+)$/i;e.isUrl=t=>r.test(t)},"../utils/lib/mergeDeepObject.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mergeDeepObject=void 0;const r=t=>{if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}return"[object Object]"===Object.prototype.toString.call(t)}return!1};e.mergeDeepObject=(...t)=>t.reduce(((t,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach((i=>{["__proto__","constructor","prototype"].includes(i)||(Array.isArray(t[i])&&Array.isArray(n[i])?t[i]=e.mergeDeepObject.options.mergeArrays?Array.from(new Set(t[i].concat(n[i]))):n[i]:r(t[i])&&r(n[i])?t[i]=(0,e.mergeDeepObject)(t[i],n[i]):t[i]=n[i])})),t}),{});const n={mergeArrays:!0};e.mergeDeepObject.options=n,e.mergeDeepObject.withOptions=(t,...r)=>{e.mergeDeepObject.options=Object.assign({mergeArrays:!0},t);const i=(0,e.mergeDeepObject)(...r);return e.mergeDeepObject.options=n,i}},"../utils/lib/objectPartition.js":function(t,e){"use strict";var r=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);ie.reduce((([t,e],n)=>{const i=e,o=n,s=i[o],u=r(i,["symbol"==typeof o?o:o+""]);return void 0!==s?[Object.assign(Object.assign({},t),{[n]:s}),u]:[t,e]}),[{},t])},"../utils/lib/parseElectrumUrl.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseElectrumUrl=void 0;const r=/^(?:([a-zA-Z0-9.-]+)|\[([a-f0-9:]+)\]):([0-9]{1,5}):([ts])$/;e.parseElectrumUrl=t=>{var e;const n=t.match(r);if(n)return{host:null!==(e=n[1])&&void 0!==e?e:n[2],port:Number.parseInt(n[3],10),protocol:n[4]}}},"../utils/lib/parseHostname.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseHostname=void 0;const r=/^([a-z0-9.+-]+:\/\/)?([a-z0-9.-]+)([:/][^:/]+)*\/?$/i;e.parseHostname=t=>{var e,n;return null===(n=null===(e=t.match(r))||void 0===e?void 0:e[2])||void 0===n?void 0:n.toLowerCase()}},"../utils/lib/promiseAllSequence.js":function(t,e,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=n))((function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.promiseAllSequence=void 0;e.promiseAllSequence=t=>i(void 0,void 0,void 0,(function*(){const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.redactUserPathFromString=e.startOfUserPathRegex=void 0,e.startOfUserPathRegex=/([/\\][Uu]sers[/\\]{1,4})([^"^'^[^\]^/^\\]*)/g;e.redactUserPathFromString=t=>t.replace(e.startOfUserPathRegex,"$1[*]")},"../utils/lib/scheduleAction.js":function(t,e,r){"use strict";var n=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=n))((function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.scheduleAction=void 0;const o=t=>Array.isArray(t),s=()=>new Error("Aborted by signal"),u=()=>new Error("Aborted by deadline"),a=()=>new Error("Aborted by timeout"),c=(t,e)=>new n(((r,n)=>{if(e.aborted)return n();if(void 0===t)return r();const i=setTimeout(r,t),o=()=>{clearTimeout(i),e.removeEventListener("abort",o),n()};e.addEventListener("abort",o)})),l=(t,e,r)=>new n(((n,i)=>{if(r.aborted)return i();const o=void 0!==t?setTimeout((()=>i(e())),t):void 0,s=()=>{clearTimeout(o),r.removeEventListener("abort",s),i()};r.addEventListener("abort",s)})),f=(t,e)=>new n(((r,n)=>{if(e.aborted)return n();if(null==t?void 0:t.aborted)return n(s());const i=()=>n(s());null==t||t.addEventListener("abort",i);const o=()=>{null==t||t.removeEventListener("abort",i),e.removeEventListener("abort",o),n()};e.addEventListener("abort",o)})),h=(t,e)=>i(void 0,void 0,void 0,(function*(){const r=new AbortController,i=()=>r.abort();e.aborted&&i(),e.addEventListener("abort",i);try{return yield new n((e=>e(t(r.signal))))}finally{e.removeEventListener("abort",i)}}));e.scheduleAction=(t,e)=>i(void 0,void 0,void 0,(function*(){const{signal:r,delay:s,attempts:p,timeout:d,deadline:y,gap:g}=e,v=y&&y-Date.now(),b=o(p)?p.length:null!=p?p:y?1/0:1,m=new AbortController,_=m.signal,w=o(p)?t=>p[t]:()=>({timeout:d,gap:g});try{return yield n.race([f(r,_),l(v,u,_),c(s,_).then((()=>((t,e,r,o)=>i(void 0,void 0,void 0,(function*(){for(let n=0;nt.abort();o.addEventListener("abort",i);try{return yield e(n,t.signal)}catch(t){i(),yield r(n)}finally{o.removeEventListener("abort",i)}}return o.aborted?n.reject():e(t-1,o)})))(b,((e,r)=>n.race([l(w(e).timeout,a,_),h(t,r)])),(t=>{var e;return c(null!==(e=w(t).gap)&&void 0!==e?e:0,_)}),_)))])}finally{m.abort()}}))},"../utils/lib/throwError.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=void 0;e.throwError=t=>{throw new Error(t)}},"../utils/lib/topologicalSort.js":(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.topologicalSort=void 0;const n=r("../utils/lib/arrayPartition.js");e.topologicalSort=(t,e,r)=>{const i=[],o=t=>(0,n.arrayPartition)(t,(r=>!t.some((t=>e(t,r)))));let s=t;for(;s.length;){const[t,e]=o(s);if(!t.length)throw new Error("Cycle detected");i.push(...r?t.sort(r):t),s=e}return i}},"../utils/lib/truncateMiddle.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.truncateMiddle=void 0;e.truncateMiddle=(t,e,r)=>{if(t.length<=e+r)return t;return`${t.substring(0,e)}…${t.substring(t.length-r,t.length)}`}},"../utils/lib/typedEventEmitter.js":(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEmitter=void 0;const n=r("../../node_modules/events/events.js");class i extends n.EventEmitter{listenerCount(t){return super.listenerCount(t)}}e.TypedEmitter=i},"../utils/lib/urlToOnion.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.urlToOnion=void 0;e.urlToOnion=(t,e)=>{var r;const[,n,i,o,s]=null!==(r=t.match(/^(http|ws)s?:\/\/([^:/]+\.)?([^/.]+\.[^/.]+)(\/.*)?$/i))&&void 0!==r?r:[];if(o&&e[o])return`${n}://${null!=i?i:""}${e[o]}${null!=s?s:""}`}},"../utils/lib/versionUtils.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeVersion=e.isNewerOrEqual=e.isEqual=e.isNewer=e.isVersionArray=void 0;e.isVersionArray=t=>{if(!Array.isArray(t))return!1;if(3!==t.length)return!1;for(let e=0;e({major:t[0],minor:t[1],patch:t[2]}),n=t=>{const r=t.split(".").map((t=>Number(t)));if(!(0,e.isVersionArray)(r))throw new Error("version string is in wrong format");return r},i=t=>`${t[0]}.${t[1]}.${t[2]}`;e.isNewer=(t,e)=>{const i=r("string"==typeof t?n(t):t),o=r("string"==typeof e?n(e):e);return i.major-o.major!=0?i.major>o.major:i.minor-o.minor!=0?i.minor>o.minor:i.patch-o.patch!=0&&i.patch>o.patch};e.isEqual=(t,e)=>("string"==typeof t?t:i(t))===("string"==typeof e?e:i(e));e.isNewerOrEqual=(t,r)=>(0,e.isNewer)(t,r)||(0,e.isEqual)(t,r);e.normalizeVersion=t=>t.replace(/\b0+(\d)/g,"$1")},"../utils/lib/xssFilters.js":(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inDoubleQuotes=e.inSingleQuotes=e.inHTML=void 0;const r=/t.replace(r,"<");e.inSingleQuotes=t=>t.replace(n,"'");e.inDoubleQuotes=t=>t.replace(i,""")},"../../node_modules/base64-js/index.js":(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r>16&255,c[l++]=e>>8&255,c[l++]=255&e;2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e);1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,u=0,c=n-i;uc?c:u+s));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(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("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function a(t,e,n){for(var i,o,s=[],u=e;u>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},"../../node_modules/buffer/index.js":(t,e,r)=>{"use strict"; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +const n=r("../../node_modules/base64-js/index.js"),i=r("../../node_modules/ieee754/index.js"),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=Buffer,e.h2=50;const s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,Buffer.prototype),e}function Buffer(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!Buffer.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|d(t,e);let n=u(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(H(t,Uint8Array)){const e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return h(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return Buffer.from(n,e,r);const i=function(t){if(Buffer.isBuffer(t)){const e=0|p(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||Y(t.length)?u(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return Buffer.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)}function c(t){if("number"!=typeof t)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 l(t){return c(t),u(t<0?0:0|p(t))}function f(t){const e=t.length<0?0:0|p(t.length),r=u(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function d(t,e){if(Buffer.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(t).length;default:if(i)return n?-1:q(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return j(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=Buffer.from(e,n)),Buffer.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){let o,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;ou&&(r=u-a),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function j(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,u,a;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(a=(31&e)<<6|63&r,a>127&&(o=a));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(a=(15&e)<<12|(63&r)<<6|63&n,a>2047&&(a<55296||a>57343)&&(o=a));break;case 4:r=t[i+1],n=t[i+2],u=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&u)&&(a=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&u,a>65535&&a<1114112&&(o=a))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(Buffer.isBuffer(e)||(e=Buffer.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!Buffer.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},Buffer.byteLength=d,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(Buffer.prototype[o]=Buffer.prototype.inspect),Buffer.prototype.compare=function(t,e,r,n,i){if(H(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const u=Math.min(o,s),a=this.slice(n,i),c=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return w(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function I(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,o){if(!Buffer.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function P(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function N(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function M(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(t,e,r,n,o){return e=+e,r>>>=0,o||M(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return e=+e,r>>>=0,o||M(t,0,r,8),i.write(t,e,r,n,52,8),r+8}Buffer.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||R(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||R(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readBigUInt64LE=J((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||R(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},Buffer.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},Buffer.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Buffer.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readBigInt64LE=J((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||R(t,4,this.length),i.read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),i.read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),i.read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),i.read(this,t,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){L(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,!n){L(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},Buffer.prototype.writeBigUInt64LE=J((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeBigUInt64BE=J((function(t,e=0){return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},Buffer.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},Buffer.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},Buffer.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},Buffer.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},Buffer.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},Buffer.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},Buffer.prototype.writeBigInt64LE=J((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeBigInt64BE=J((function(t,e=0){return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeFloatLE=function(t,e,r){return x(this,t,e,!0,r)},Buffer.prototype.writeFloatBE=function(t,e,r){return x(this,t,e,!1,r)},Buffer.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},Buffer.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},Buffer.prototype.copy=function(t,e,r,n){if(!Buffer.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new C.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){V(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function V(t,e){if("number"!=typeof t)throw new C.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw V(t,r),new C.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new C.ERR_BUFFER_OUT_OF_BOUNDS;throw new C.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}k("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),k("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),k("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Q(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const K=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function J(t){return"undefined"==typeof BigInt?X:t}function X(){throw new Error("BigInt not supported")}},"../../node_modules/es6-promise/dist/es6-promise.js":function(t,e,r){var n=r("../../node_modules/process/browser.js"); +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.8+1e68dce6 + */t.exports=function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=0,s=void 0,u=void 0,a=function(t,e){w[o]=t,w[o+1]=e,2===(o+=2)&&(u?u(E):j())};function c(t){u=t}function l(t){a=t}var f="undefined"!=typeof window?window:void 0,h=f||{},p=h.MutationObserver||h.WebKitMutationObserver,d="undefined"==typeof self&&"[object process]"==={}.toString.call(n),y="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function g(){return function(){return n.nextTick(E)}}function v(){return void 0!==s?function(){s(E)}:_()}function b(){var t=0,e=new p(E),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function m(){var t=new MessageChannel;return t.port1.onmessage=E,function(){return t.port2.postMessage(0)}}function _(){var t=setTimeout;return function(){return t(E,1)}}var w=new Array(1e3);function E(){for(var t=0;t{"use strict";var n,i=r("../../node_modules/es6-promise/dist/es6-promise.js").Promise,o="object"==typeof Reflect?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var u=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(t,e){return new i((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}b(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&b(t,"error",e,r)}(t,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var i,events,o,s;if(l(r),void 0===(events=t._events)?(events=t._events=Object.create(null),t._eventsCount=0):(void 0!==events.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),events=t._events),o=events[e]),void 0===o)o=events[e]=r,++t._eventsCount;else if("function"==typeof o?o=events[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=f(t))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return t}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=p.bind(n);return i.listener=r,n.wrapFn=i,i}function y(t,e,r){var events=t._events;if(void 0===events)return[];var n=events[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(i=e[0]),i instanceof Error)throw i;var o=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw o.context=i,o}var u=events[t];if(void 0===u)return!1;if("function"==typeof u)s(u,this,e);else{var a=u.length,c=v(u,a);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return y(this,t,!0)},a.prototype.rawListeners=function(t){return y(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},"../../node_modules/ieee754/index.js":(t,e)=>{ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +e.read=function(t,e,r,n,i){var o,s,u=8*i-n-1,a=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=u;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,u,a,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+f>=1?h/a:h*Math.pow(2,1-f))*a>=2&&(s++,a/=2),s+f>=l?(u=0,s=l):s+f>=1?(u=(e*a-1)*Math.pow(2,i),s+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&u,p+=d,u/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},"../../node_modules/process/browser.js":t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var u,a=[],c=!1,l=-1;function f(){c&&u&&(c=!1,u.length?a=u.concat(a):l=-1,a.length&&h())}function h(){if(!c){var t=s(f);c=!0;for(var e=a.length;e;){for(u=a,a=[];++l1)for(var r=1;r{s.forEach((e=>{e.postMessage({type:"descriptors",payload:t})}))})),self.onconnect=function(t){const e=t.ports[0];s.push(e),e.addEventListener("message",(t=>{((t,e)=>{i(void 0,void 0,void 0,(function*(){const r=yield o.handleMessage(t);e.postMessage(r)}))})(t.data,e)})),e.start()}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();r("../transport/lib/sessions/background-sharedworker.js")})(); \ No newline at end of file diff --git a/app/trezor-prebuild/build/workers/shared-logger-worker.js b/app/trezor-prebuild/build/workers/shared-logger-worker.js new file mode 100644 index 0000000000..d92d282f42 --- /dev/null +++ b/app/trezor-prebuild/build/workers/shared-logger-worker.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=[],s=[],t=[];self.addEventListener("connect",(a=>{const o=a.ports[0];e.push(o),o.addEventListener("message",(e=>{!function(e,a){const{type:o,data:n}=e;switch(o){case"add-log":t.push(n),t.length>1e3&&t.shift(),s.length>0&&s.forEach((e=>{e.postMessage({type:"log-entry",payload:n})}));break;case"get-logs":a.postMessage({type:"get-logs",payload:t});break;case"subscribe":s.push(a)}}(e.data,o)})),o.start()}))})(); \ No newline at end of file diff --git a/package.json b/package.json index 466fa35e02..e2b3769498 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,8 @@ "hot-server": "node server.mjs", "build-main": "webpack --config webpack/electron.prod.js --progress=profile --color", "build-renderer": "webpack --config webpack/ui.prod.js --progress=profile --color", - "build-trezor": "webpack --config webpack/trezor.js --progress=profile --color", "build-preload": "webpack --config webpack/preload.prod.js --progress=profile --color", - "build": "yarn build-trezor && yarn build-preload && yarn build-main && yarn build-renderer", + "build": "yarn build-preload && yarn build-main && yarn build-renderer", "rebuild-natives": "node_modules/.bin/electron-rebuild", "rebuild-dexc": "cd modules/dex && npm run install", "start": "cross-env NODE_ENV=production electron ./app/ --debug --custombinpath=./bin", @@ -110,7 +109,7 @@ "/app/middleware/ln/google/", "/bin/", "/app/dist/", - "/app/dist-trezor/", + "/app/trezor-prebuild/build/", "/app/i18n/lib/" ] }, @@ -276,6 +275,7 @@ "@ledgerhq/hw-app-btc": "^10.0.5", "@ledgerhq/hw-transport-webusb": "6.27.1", "@peculiar/webcrypto": "1.4.3", + "@trezor/connect-web": "9.0.11", "@xstate/react": "^0.8.1", "blake-hash": "^2.0.0", "bs58": "^4.0.1", @@ -330,7 +330,6 @@ "stylelint": "13.13.1", "stylelint-config-recommended": "^4.0.0", "timezone-mock": "1.3.6", - "trezor-connect": "8.2.12-extended", "utf-8-validate": "5.0.10", "worker-loader": "^3.0.8", "xstate": "4.37.2" diff --git a/webpack/trezor.js b/webpack/trezor.js deleted file mode 100644 index 3fa4713f5d..0000000000 --- a/webpack/trezor.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Build config for trezor's iframe. This is used to contact trezor-bridge on a - * separate iframe in the wallet. - */ - -const NodePolyfillPlugin = require("node-polyfill-webpack-plugin"); -const path = require("path"); -const webpack = require("webpack"); -const HtmlWebpackPlugin = require("html-webpack-plugin"); -const CopyWebpackPlugin = require("copy-webpack-plugin"); -const TerserPlugin = require("terser-webpack-plugin"); - -module.exports = { - mode: "production", - - target: "web", - - entry: "./node_modules/trezor-connect/lib/iframe/iframe.js", - - devtool: "inline-source-map", - - output: { - filename: "trezor-iframe.js", - path: path.join(__dirname, "../app/dist-trezor"), - publicPath: "./" - }, - - module: { - rules: [ - { - test: /\.js?$/, - exclude: /node_modules/, - use: ["babel-loader"] - } - ] - }, - - resolve: { - modules: ["node_modules"] - }, - - plugins: [ - // fix blake2b import - new webpack.NormalModuleReplacementPlugin(/.blake2b$/, "./blake2b.js"), - - new HtmlWebpackPlugin({ - // trezor-connect doesn't allow overriding the iframe source file, - // so we need to use the too-generic "iframe.html" filename. - filename: "iframe.html", - template: "./app/trezor-iframe.development.html", - scriptLoading: "blocking" - }), - - new CopyWebpackPlugin({ - patterns: [ - { from: "./node_modules/trezor-connect/data", to: "data" } - ] - }), - - new webpack.DefinePlugin({ - "process.env.NODE_DEBUG": false - }), - - new webpack.ProvidePlugin({ - Buffer: ["buffer", "Buffer"] - }), - - new NodePolyfillPlugin() - ], - - optimization: { - minimizer: [ - new TerserPlugin({ - parallel: true, - extractComments: false, - terserOptions: { - ecma: 6, - mangle: { - reserved: [ - "Array", - "BigInteger", - "Boolean", - "Buffer", - "ECPair", - "Function", - "Number", - "Point", - "Script" - ] - } - } - }) - ] - } -}; diff --git a/webpack/ui.dev.js b/webpack/ui.dev.js index 5daa13a937..26ee4882a3 100644 --- a/webpack/ui.dev.js +++ b/webpack/ui.dev.js @@ -98,7 +98,7 @@ module.exports = merge(baseConfig, { new CopyWebpackPlugin({ patterns: [ // Copy the generated trezor iframe and code. - { from: "./app/dist-trezor", to: "" } + { from: "./app/trezor-prebuild/build", to: "" } ] }), diff --git a/webpack/ui.prod.js b/webpack/ui.prod.js index 6082b93380..a27137a088 100644 --- a/webpack/ui.prod.js +++ b/webpack/ui.prod.js @@ -49,7 +49,7 @@ module.exports = merge(baseConfig, { new CopyWebpackPlugin({ patterns: [ // Copy the generated trezor iframe and code. - { from: "./app/dist-trezor", to: "" } + { from: "./app/trezor-prebuild/build", to: "" } ] }), diff --git a/yarn.lock b/yarn.lock index 3de5e82cb4..15788a7d43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1899,9 +1899,9 @@ eslint-scope "5.1.1" "@noble/hashes@^1.2.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" - integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -2246,6 +2246,13 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== +"@trezor/analytics@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@trezor/analytics/-/analytics-1.0.3.tgz#a150efae76ca912e1331f0a5754317368ec1fac4" + integrity sha512-7a0bHkY/+z6cDRoh1ZkhffHGw7iaVayD1UpP3fm4lPzrRpGQeH9ksRg8ZT0mBs6Pj+TLETzZRrS5ZBpDK0Piug== + dependencies: + "@trezor/utils" "9.0.9" + "@trezor/blockchain-link-types@1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@trezor/blockchain-link-types/-/blockchain-link-types-1.0.2.tgz#00e254acef04c7575e8d0efe2f05e17d1fb6ef52" @@ -2259,7 +2266,7 @@ "@trezor/utils" "9.0.8" bignumber.js "^9.1.1" -"@trezor/blockchain-link@^2.1.3": +"@trezor/blockchain-link@2.1.13": version "2.1.13" resolved "https://registry.yarnpkg.com/@trezor/blockchain-link/-/blockchain-link-2.1.13.tgz#0f355910239f7ec863f373ec2f97c4f271e294fa" integrity sha512-5yRvP8cFKjYd3FBRmUS6VJxHRLm8IuQg237hcRF8RbYRgW6ev7dwkjYmcVYz2iWXGaz+/FV8G0/xB/pmHhrpPQ== @@ -2275,30 +2282,65 @@ socks-proxy-agent "6.1.1" ws "7.5.9" -"@trezor/connect-common@^0.0.10": - version "0.0.10" - resolved "https://registry.yarnpkg.com/@trezor/connect-common/-/connect-common-0.0.10.tgz#cf5ff55f97c7b0093598ed56f444c67e5c0b59d8" - integrity sha512-bwqB5J6IrLBZ/tGQw/C/EoYZW6Jpjf6ch9sYUog4EVTNIqh5nCLP+g8ShSyco9lvrKInMDXDWwU6OsEZE5gcPQ== +"@trezor/connect-analytics@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@trezor/connect-analytics/-/connect-analytics-1.0.2.tgz#a9017f5f41f36bdddfd23ca1f3b05b213a51e064" + integrity sha512-eUAWb1nc5wGAKmNVTmiOc9DlFr+mbG+1JevzVUFB2q3VLQzcjf0st+RWE5DuDnPUVJiJFxBQWTqWlzACtq/HzQ== + dependencies: + "@trezor/analytics" "1.0.3" -"@trezor/rollout@^1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@trezor/rollout/-/rollout-1.3.2.tgz#9120f77c31bb12253a509b7b894b3777317dd763" - integrity sha512-P660yMKCM0rKJZXEH+YmTYXLdrxcKquapSnC7YUa5cf0jVG8rNQLeETnaS6YnYjbYXRxtmUWL/537bfj6dZeWw== +"@trezor/connect-common@0.0.16": + version "0.0.16" + resolved "https://registry.yarnpkg.com/@trezor/connect-common/-/connect-common-0.0.16.tgz#372395136f9f53ddc02348b74c8f7771c84262be" + integrity sha512-DPGWhNYTe8SQO/XzqvVtY5YCOtRGHChN01J2Z5p3xD6aFGceou7SE0ROOcqU0ceSzMgl13+I9I0qXq/OLTGBGw== dependencies: - "@trezor/utils" "^1.0.0" - cross-fetch "^3.1.5" - runtypes "^6.5.1" + "@trezor/env-utils" "1.0.2" -"@trezor/transport@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@trezor/transport/-/transport-1.1.2.tgz#a176257d269724045e2860c0255e7663d1a00424" - integrity sha512-Fh81+R/SQmaRcfT6efAOf9xsgxXxPW9tEcREe8tiou3HVPITyQOCKvC5+1R8lqEPZRTZnil0l22a1c/cfFpIww== +"@trezor/connect-web@9.0.11": + version "9.0.11" + resolved "https://registry.yarnpkg.com/@trezor/connect-web/-/connect-web-9.0.11.tgz#7526eef7a0b7d33b431613e80529312e78d8b1c4" + integrity sha512-9398lmzxPGm/aZGM9OvkjasQ4kUQQs5bYz79eDtFz3jf24SyMM1yf2KvdvdssIyIfvcAbyJLZ+DK1qw2HxWn/Q== + dependencies: + "@trezor/connect" "9.0.11" + "@trezor/utils" "9.0.9" + events "^3.3.0" + +"@trezor/connect@9.0.11": + version "9.0.11" + resolved "https://registry.yarnpkg.com/@trezor/connect/-/connect-9.0.11.tgz#99b341bdabf16a1216c3343b659bcca9c44a5854" + integrity sha512-8fifMt3xtqIQ4122aHNb8e3l0uisVujsWXUJ/LQS6N+t6SnilohBZ8nfzUBQaCxo2JuorLuXmxQ1ngNpaL45TA== dependencies: - "@trezor/utils" "^1.0.0" + "@trezor/blockchain-link" "2.1.13" + "@trezor/connect-analytics" "1.0.2" + "@trezor/connect-common" "0.0.16" + "@trezor/transport" "1.1.12" + "@trezor/utils" "9.0.9" + "@trezor/utxo-lib" "1.0.7" + bignumber.js "^9.1.1" + blakejs "^1.2.1" + cross-fetch "^3.1.6" + events "^3.3.0" + randombytes "2.1.0" + tslib "2.5.2" + +"@trezor/env-utils@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@trezor/env-utils/-/env-utils-1.0.2.tgz#b68cef4b1f9e4959f16290aef04b48a09c52e5ce" + integrity sha512-fPrX6EjaMHnRwAje7h2H3Qgu5/sBoewE8441j8cbBzxfJRgRuQJYZaGCy7lDALjxEwp7g02ZZ/FWavIhWGZIcQ== + dependencies: + ua-parser-js "^1.0.34" + +"@trezor/transport@1.1.12": + version "1.1.12" + resolved "https://registry.yarnpkg.com/@trezor/transport/-/transport-1.1.12.tgz#ba88abcfc47b2c1b34392fdde7aa8dffce4129b7" + integrity sha512-RInOSOmgJ383QOBJbPzjyQW9BoWZ6HTneUmPkdzqydLxn9eyD3Ui13+W9fWFmxoMmljxJKct93twgxgHKUkhCg== + dependencies: + "@trezor/utils" "9.0.9" bytebuffer "^5.0.1" - json-stable-stringify "^1.0.1" + json-stable-stringify "^1.0.2" long "^4.0.0" - protobufjs "^6.11.2" + prettier "2.8.7" + protobufjs "6.11.3" "@trezor/utils@9.0.8": version "9.0.8" @@ -2310,12 +2352,7 @@ resolved "https://registry.yarnpkg.com/@trezor/utils/-/utils-9.0.9.tgz#2082d0ed4d3bbda83403be43f3cf56ae50b7805f" integrity sha512-+jzHy+YG3zJsnB11YfudT1a5u5lcwNX/tKoW9VmPU+isuW725M6uUOL+MSgW1aHucCJPyBAp0XUUssLE/ifqBw== -"@trezor/utils@^1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@trezor/utils/-/utils-1.0.1.tgz#594e31343bef1bec39ad7aad4624dd2a1329eb4a" - integrity sha512-+XYu51Zc3eM6bc8e1C3xrGHpryj6HsI4Gy3fdjhs8qiYGlVBJ6yMOsuNB4k2JHQiBNyhSn6Jw+VztH+ZYps1kQ== - -"@trezor/utxo-lib@1.0.7", "@trezor/utxo-lib@^1.0.0": +"@trezor/utxo-lib@1.0.7": version "1.0.7" resolved "https://registry.yarnpkg.com/@trezor/utxo-lib/-/utxo-lib-1.0.7.tgz#0bfaf053ee06bf2a2c778101fceee608325c1493" integrity sha512-brC5xqGgT6yloHz3RWUK1CdEYkOSEjrhYM18GAzAaqS4MBULWDBPDD5Qt2XcYTOaoR/+8PKUXHdHVm+olbRSlA== @@ -2568,9 +2605,9 @@ "@types/node" "*" "@types/lodash@^4.14.136": - version "4.14.195" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632" - integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg== + version "4.14.199" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.199.tgz#c3edb5650149d847a277a8961a7ad360c474e9bf" + integrity sha512-Vrjz5N5Ia4SEzWWgIVwnHNEnb1UE1XMkvY5DGXrAeOGE9imk0hgTHh5GyDjLDJi9OTCn9oo9dXH1uToK1VRfrg== "@types/long@^4.0.1": version "4.0.2" @@ -3667,7 +3704,7 @@ base-x@^4.0.0: resolved "https://registry.yarnpkg.com/base-x/-/base-x-4.0.0.tgz#d0e3b7753450c73f8ad2389b5c018a4af7b2224a" integrity sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw== -base64-js@^1.0.2, base64-js@^1.3.1, base64-js@^1.5.1: +base64-js@^1.3.1, base64-js@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -3720,10 +3757,10 @@ big.js@^5.2.2: resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== -bignumber.js@^9.0.0, bignumber.js@^9.0.2, bignumber.js@^9.1.1: - version "9.1.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" - integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== +bignumber.js@^9.0.0, bignumber.js@^9.1.1: + version "9.1.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" + integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== bindings@^1.3.0: version "1.5.0" @@ -3866,11 +3903,6 @@ boolean@^3.0.1: resolved "https://registry.yarnpkg.com/boolean/-/boolean-3.2.0.tgz#9e5294af4e98314494cbb17979fa54ca159f116b" integrity sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw== -bowser@^2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/bowser/-/bowser-2.11.0.tgz#5ca3c35757a7aa5771500c70a73a9f91ef420a8f" - integrity sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA== - boxen@^5.0.0: version "5.1.2" resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" @@ -4085,13 +4117,13 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== -buffer@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" - integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== +buffer@6.0.3, buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" + base64-js "^1.3.1" + ieee754 "^1.2.1" buffer@^5.1.0, buffer@^5.5.0: version "5.7.1" @@ -4101,14 +4133,6 @@ buffer@^5.1.0, buffer@^5.5.0: base64-js "^1.3.1" ieee754 "^1.1.13" -buffer@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" - integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - bufferutil@4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.7.tgz#60c0d19ba2c992dd8273d3f73772ffc894c153ad" @@ -4293,11 +4317,6 @@ cashaddrjs@0.4.4: dependencies: big-integer "1.6.36" -cbor-web@^7.0.6: - version "7.0.6" - resolved "https://registry.yarnpkg.com/cbor-web/-/cbor-web-7.0.6.tgz#6e23a0c58db4c38e485e395de511b9e2f628961c" - integrity sha512-A6ZH12jcDJG9PS7StugO78G+ok23SAjxMugGInPBy4IItiH6hYzybi6HQkGjWw9jBEGQpIBkleB2mizxYZIpLw== - ccount@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" @@ -4876,12 +4895,12 @@ cross-env@^7.0.3: dependencies: cross-spawn "^7.0.1" -cross-fetch@^3.1.5: - version "3.1.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.6.tgz#bae05aa31a4da760969756318feeee6e70f15d6c" - integrity sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g== +cross-fetch@^3.1.6: + version "3.1.8" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" + integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg== dependencies: - node-fetch "^2.6.11" + node-fetch "^2.6.12" cross-spawn@^6.0.0: version "6.0.5" @@ -7459,7 +7478,7 @@ identity-obj-proxy@^3.0.0: dependencies: harmony-reflect "^1.4.6" -ieee754@^1.1.13, ieee754@^1.1.4, ieee754@^1.2.1: +ieee754@^1.1.13, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -8671,7 +8690,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stable-stringify@1.0.2, json-stable-stringify@^1.0.1: +json-stable-stringify@1.0.2, json-stable-stringify@^1.0.1, json-stable-stringify@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz#e06f23128e0bbe342dc996ed5a19e28b57b580e0" integrity sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g== @@ -9747,7 +9766,14 @@ node-api-version@^0.1.4: dependencies: semver "^7.3.5" -node-fetch@^2.6.11, node-fetch@^2.6.7: +node-fetch@^2.6.12: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + +node-fetch@^2.6.7: version "2.6.11" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25" integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== @@ -10284,11 +10310,6 @@ parse-ms@^2.1.0: resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-2.1.0.tgz#348565a753d4391fa524029956b172cb7753097d" integrity sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA== -parse-uri@^1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/parse-uri/-/parse-uri-1.0.7.tgz#287629a09328a97e398468f21b8a00c4a2d9cc73" - integrity sha512-eWuZCMKNlVkXrEoANdXxbmqhu2SQO9jUMCSpdbJDObin0JxISn6e400EWsSRbr/czdKvWKkhZnMKEGUwf/Plmg== - parse5-htmlparser2-tree-adapter@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz#23c2cc233bcf09bb7beba8b8a69d46b08c62c2f1" @@ -10944,6 +10965,11 @@ prettier@2.7.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== +prettier@2.8.7: + version "2.8.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" + integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== + pretty-error@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6" @@ -11059,7 +11085,26 @@ property-information@^5.3.0: dependencies: xtend "^4.0.0" -protobufjs@^6.11.2, protobufjs@^6.8.0: +protobufjs@6.11.3: + version "6.11.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" + integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" + long "^4.0.0" + +protobufjs@^6.8.0: version "6.11.4" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== @@ -11990,36 +12035,36 @@ ripemd160@2, ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -ripple-address-codec@^4.1.1, ripple-address-codec@^4.2.5: - version "4.2.5" - resolved "https://registry.yarnpkg.com/ripple-address-codec/-/ripple-address-codec-4.2.5.tgz#9d31b2066abd4cf1a135cd865b4e8e63269701e7" - integrity sha512-SZ96zZH+0REeyEcYVFl0vqcsGRXiFXS2RUgHupHhtVkOEk6men53vngVjJwBrSnY+oa6Cri15q1zSni3DEoxNw== +ripple-address-codec@^4.1.1, ripple-address-codec@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/ripple-address-codec/-/ripple-address-codec-4.3.1.tgz#68fbaf646bb8567f70743af7f1ce4479f73efbf6" + integrity sha512-Qa3+9wKVvpL/xYtT6+wANsn0A1QcC5CT6IMZbRJZ/1lGt7gmwIfsrCuz1X0+LCEO7zgb+3UT1I1dc0k/5dwKQQ== dependencies: base-x "^3.0.9" create-hash "^1.1.2" ripple-binary-codec@^1.1.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/ripple-binary-codec/-/ripple-binary-codec-1.4.3.tgz#4737044f2aa5da496c1d57619339f26df01cd494" - integrity sha512-P4ALjAJWBJpRApTQO+dJCrHE6mZxm7ypZot9OS0a3RCKOWTReNw0pDWfdhCGh1qXh71TeQnAk4CHdMLwR/76oQ== + version "1.10.0" + resolved "https://registry.yarnpkg.com/ripple-binary-codec/-/ripple-binary-codec-1.10.0.tgz#549f7fb3d3faf6b2d09fe7032bdcc4e6f8b5a511" + integrity sha512-qWXxubgXBV3h5NTaaLiusZ1FhPqSy+bCYHHarfZ3bMmO2alRa1Ox61jvX1Zyozok8PcF3gs3bKwZci4RTlA07w== dependencies: assert "^2.0.0" big-integer "^1.6.48" - buffer "5.6.0" + buffer "6.0.3" create-hash "^1.2.0" decimal.js "^10.2.0" - ripple-address-codec "^4.2.5" + ripple-address-codec "^4.3.1" ripple-keypairs@^1.0.3: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ripple-keypairs/-/ripple-keypairs-1.1.5.tgz#eabfc371f2ef293fdc462664e18cbba32c4f5c7e" - integrity sha512-wLJXIBsMVazn2Yp/7oP4PvgA4Gd1HtuZLftdEJFNOLgraf82phqa2AnNK3t9f3XeQnApW1jAe/FcFFOY6QUn5w== + version "1.3.1" + resolved "https://registry.yarnpkg.com/ripple-keypairs/-/ripple-keypairs-1.3.1.tgz#7fa531df36b138134afb53555a87d7f5eb465b2e" + integrity sha512-dmPlraWKJciFJxHcoubDahGnoIalG5e/BtV6HNDUs7wLXmtnLMHt6w4ed9R8MTL2zNrVPiIdI/HCtMMo0Tm7JQ== dependencies: bn.js "^5.1.1" brorand "^1.0.5" elliptic "^6.5.4" hash.js "^1.0.3" - ripple-address-codec "^4.2.5" + ripple-address-codec "^4.3.1" ripple-lib-transactionparser@0.8.2: version "0.8.2" @@ -12078,11 +12123,6 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -runtypes@^6.5.1: - version "6.6.0" - resolved "https://registry.yarnpkg.com/runtypes/-/runtypes-6.6.0.tgz#48e353d8b0f641ab5ec5d80fa96dd7bd41ea3281" - integrity sha512-ddM7sgB3fyboDlBzEYFQ04L674sKjbs4GyW2W32N/5Ae47NRd/GyMASPC2PFw8drPHYGEcZ0mZ26r5RcB8msfQ== - rxjs@6: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" @@ -13217,25 +13257,6 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -trezor-connect@8.2.12-extended: - version "8.2.12-extended" - resolved "https://registry.yarnpkg.com/trezor-connect/-/trezor-connect-8.2.12-extended.tgz#6ded35e9b532282ce4c66061d70c9592632556ff" - integrity sha512-/NH6+rKWT7Ie3FS38S6KK+OWqqXdwCEor09RXIXVE3S14Y9TqhXcBzzs3k8/hNFHRevU0jIBxFbfI7hZKktGrQ== - dependencies: - "@babel/runtime" "^7.15.4" - "@trezor/blockchain-link" "^2.1.3" - "@trezor/connect-common" "^0.0.10" - "@trezor/rollout" "^1.3.2" - "@trezor/transport" "1.1.2" - "@trezor/utxo-lib" "^1.0.0" - bignumber.js "^9.0.2" - bowser "^2.11.0" - cbor-web "^7.0.6" - cross-fetch "^3.1.5" - events "^3.3.0" - parse-uri "^1.0.5" - randombytes "2.1.0" - trim-newlines@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" @@ -13263,16 +13284,16 @@ tsconfig-paths@^3.10.1: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@2.5.2, tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.5.0: + version "2.5.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.2.tgz#1b6f07185c881557b0ffa84b111a0106989e8338" + integrity sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA== + tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.5.0: - version "2.5.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.2.tgz#1b6f07185c881557b0ffa84b111a0106989e8338" - integrity sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA== - tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" @@ -13375,6 +13396,11 @@ typescript@^3.9.10, typescript@^3.9.5, typescript@^3.9.7: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== +ua-parser-js@^1.0.34: + version "1.0.36" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.36.tgz#a9ab6b9bd3a8efb90bb0816674b412717b7c428c" + integrity sha512-znuyCIXzl8ciS3+y3fHJI/2OhQIXbXw9MWC/o3qwyR+RGppjZHrM27CGFSKCJXi2Kctiz537iOu2KnXs1lMQhw== + unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e"